From 6831d3735af11d5bdf8ccbac38682bd540c3e42d Mon Sep 17 00:00:00 2001 From: Kevin Rowlandson Date: Wed, 1 Jul 2020 08:43:09 +0100 Subject: [PATCH] Updated PSScriptAnalyzer validation for pwsh --- lib/worker.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/worker.sh b/lib/worker.sh index fd0481a0..15d89442 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -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 #######################