-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
PowerShell/Request-Certificate.ps1
Line 366 in 71ad361
| $CAName = "$($CAs[0].Properties.dnshostname)\$($CAs[0].Properties.cn)" |
in order to get the newest CA (in case of a CA which is older but alphabetically before the new CA) change this line (366) to:
if($CAs.Count -ge 1){
$newestCA = $CAs | Sort-Object -Property {$_.Properties.whenchanged} -Descending | Select -First 1
$CAName = "$($newestCA.Properties.dnshostname)\$($newestCA.Properties.cn)"
}
else {
$CAName = ""
}
Further... it is more readable than using the Index 0 of the Array. :)
Thanks for your code. It helps a lot. I will adapt it for me