Sample code for 30+ languages & platforms
PowerShell Requires Chilkat v11.0.0+

Transition from Cert.GetValidToDt to Cert.ValidToStr

Provides instructions for replacing deprecated GetValidToDt method calls with ValidToStr.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$cert = New-Object Chilkat.Cert

#  ------------------------------------------------------------------------
#  The GetValidToDt method is deprecated:

$ckdt1 = $cert.GetValidToDt()
if ($cert.LastMethodSuccess -eq $false) {
    $($cert.LastErrorText)
    exit
}

#  ...
#  ...

#  ------------------------------------------------------------------------
#  Do the equivalent using the ValidToStr property

$ckdt2 = New-Object Chilkat.CkDateTime
$ckdt2.SetFromRfc822($cert.ValidToStr)