diff --git a/.github/workflows/scriptAnalyzer.yaml b/.github/workflows/scriptAnalyzer.yaml index 566d5e1272884..79ff49461f34e 100644 --- a/.github/workflows/scriptAnalyzer.yaml +++ b/.github/workflows/scriptAnalyzer.yaml @@ -8,11 +8,13 @@ on: - "**/*.ps1" - "**/*.psm1" - "**/*.psd1" + - ".github/workflows/scriptAnalyzer.yaml" push: paths: - "**/*.ps1" - "**/*.psm1" - "**/*.psd1" + - ".github/workflows/scriptAnalyzer.yaml" permissions: contents: read # Needed to check out the code @@ -32,8 +34,7 @@ jobs: - name: Run PSScriptAnalyzer run: | # Run PSScriptAnalyzer on all PowerShell scripts - $results = @(Get-ChildItem -Recurse -Filter *.ps1 | Invoke-ScriptAnalyzer) - $results += @(Get-ChildItem -Recurse -Filter *.psm1 | Invoke-ScriptAnalyzer) + $results = @(Invoke-ScriptAnalyzer -Path . -Recurse) if ($results) { Write-Output $results | Format-List -GroupBy ScriptName }