Add known-safe finding downgrades #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PSScriptAnalyzer | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| analyze: | |
| name: Analyze PowerShell scripts | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Install PSScriptAnalyzer | |
| shell: pwsh | |
| run: | | |
| Install-Module PSScriptAnalyzer -Force -Scope CurrentUser | |
| - name: Run PSScriptAnalyzer | |
| shell: pwsh | |
| run: | | |
| $Results = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Error,Warning | |
| $Results | Format-Table -AutoSize | |
| $Errors = @($Results | Where-Object Severity -eq 'Error') | |
| if ($Errors.Count -gt 0) { | |
| throw "PSScriptAnalyzer found $($Errors.Count) error-level finding(s)." | |
| } |