From a8c3dd3b34d6fc21b1cb842917fa006bd124e815 Mon Sep 17 00:00:00 2001 From: ThomasHughesIV <42014035+ThomasHughesIV@users.noreply.github.com> Date: Sat, 13 Jun 2020 12:32:14 -0700 Subject: [PATCH] Esnured private key is there, and cert > NotAfter --- source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 b/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 index e4ffa5e2f..9de05202c 100644 --- a/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 +++ b/source/DSCResources/MSFT_xWebSite/MSFT_xWebSite.psm1 @@ -1473,7 +1473,7 @@ function ConvertTo-WebBinding if ($FindCertificateSplat) { $FindCertificateSplat.Add('Store',$CertificateStoreName) - $Certificate = Find-Certificate @FindCertificateSplat | Sort-Object -Property NotAfter -Descending | Select-Object -First 1 + $Certificate = Find-Certificate @FindCertificateSplat | Where-Object {$_.PrivateKey -ne ''} | Sort-Object -Property NotAfter -Descending | Select-Object -First 1 if ($Certificate) { $certificateHash = $Certificate.Thumbprint