File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 push :
55 branches : [main]
66 pull_request :
7+ branches : [main]
8+ workflow_dispatch :
9+
10+ permissions :
11+ contents : read
712
813jobs :
914 analyze :
@@ -14,16 +19,29 @@ jobs:
1419 - name : Checkout
1520 uses : actions/checkout@v6
1621
22+ - name : Check PowerShell script syntax
23+ shell : pwsh
24+ run : pwsh -NoProfile -File tools/test-powershell-syntax.ps1
25+
26+ - name : Check Markdown relative links
27+ shell : pwsh
28+ run : pwsh -NoProfile -File tools/test-markdown-links.ps1
29+
1730 - name : Install analyzer
1831 shell : pwsh
1932 run : |
20- Install-Module PSScriptAnalyzer -Scope CurrentUser -Force
33+ Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force
2134
2235 - name : Run PSScriptAnalyzer
2336 shell : pwsh
2437 run : |
25- $results = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Error
38+ $results = Invoke-ScriptAnalyzer -Path . -Recurse -Settings PSScriptAnalyzerSettings.psd1
2639 $results | Format-Table -AutoSize
27- if ($results.Count -gt 0) {
28- exit 1
40+
41+ $errors = @($results | Where-Object { $_.Severity -eq 'Error' })
42+ if ($errors.Count -gt 0) {
43+ $errors | Format-Table -AutoSize
44+ throw "PSScriptAnalyzer found error-level issues."
2945 }
46+
47+ Write-Host "PSScriptAnalyzer completed: $($results.Count) finding(s), $($errors.Count) error(s)."
You can’t perform that action at this time.
0 commit comments