Skip to content

Add known-safe finding downgrades #6

Add known-safe finding downgrades

Add known-safe finding downgrades #6

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)."
}