Closed davidcatriel closed 3 months ago
Update: upon further investigation, it looks like the yml file needs the 'pwsh: true' flag added to ensure the script runs under powershell 7 (same thing is present in the yml for the csv report - https://github.com/microsoft/GHAzDO-Resources/blob/main/src/csv-report/ghazdo-csv-report.yml).
# Compare CodeQL / Dependency issues on the PR source and target branches.
# Fail if there are new issues.
- task: PowerShell@2
displayName: 'CI Gating - verify there are no new security issues introduced in this PR'
inputs:
targetType: filePath
filePath: CIGate.ps1
pwsh: true # Script requires PS7 (otherwise you will see syntax error - Unexpected token '?' )
env:
MAPPED_ADO_PAT: $(GATING_PAT)
Hello
I've updated to the latest version of CIGate.ps1 (with the fix for issue #42), and am now getting a syntax error when the pipeline runs it. I've verified that the machine this runs on has the default Windows powershell installed, and runs the previous version of the script without an issue.
Do we need to upgrade to Powershell 7 to use the latest version of the script? I couldn't find a minimum supported version of Powershell in the docs for these extensions.
Log output: