Updated PSScriptAnalyzer validation for pwsh

This commit is contained in:
Kevin Rowlandson 2020-07-01 08:43:09 +01:00
parent 6b60348fd5
commit 6831d3735a
No known key found for this signature in database
GPG key ID: F33348ACAE26BE84

View file

@ -69,6 +69,11 @@ function LintCodebase()
# If module found, ensure Invoke-ScriptAnalyzer command is available
if [[ "$VALIDATE_PSSA_MODULE" == "PSScriptAnalyzer" ]]; then
VALIDATE_PSSA_CMD=$(pwsh -c "(Get-Command Invoke-ScriptAnalyzer | Select-Object -First 1).Name" 2>&1)
else
exit 1
fi
if [[ "$VALIDATE_PSSA_CMD" != "Invoke-ScriptAnalyzer" ]]; then
exit 1
fi
#######################