Skip to content

Commit

Permalink
Sorted found certificates by notafter date desc
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHughesIV committed Jun 12, 2020
1 parent c7c81dc commit 1debf55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ function ConvertTo-WebBinding
if ($FindCertificateSplat)
{
$FindCertificateSplat.Add('Store',$CertificateStoreName)
$Certificate = Find-Certificate @FindCertificateSplat | Select-Object -First 1
$Certificate = Find-Certificate @FindCertificateSplat | Sort-Object -Property NotAfter -Descending | Select-Object -First 1
if ($Certificate)
{
$certificateHash = $Certificate.Thumbprint
Expand Down

0 comments on commit 1debf55

Please sign in to comment.