Azure-Samples/azure-mfa-nps-extension-health-check

"Checking if there is a matched certificate with Azure MFA" will fail if there is only 1 matched certificate

jessie-pang opened this issue · 1 comments

The "Checking if there is a matched certificate with Azure MFA" will fail (and appear twice in the report) if there is only 1 matched certificate:
image

When the $MatchedCert only has 1 item, it will be considered as a string. And the $MatchedCert[0] will be the first character, instead of the whole string (certificate thumbprint):
image

The issue can be resolved by modifying the line from:

$MatchedCert = $TP | Where {$localCert -Contains $_}

To:

$MatchedCert = @($TP | Where {$localCert -Contains $_})

image

@jessie-pang thank you! this is fixed.