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