File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
scripts/tests/PSScriptAnalyzer Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -78,11 +78,12 @@ Describe 'PSScriptAnalyzer' {
7878 PSScriptRoot = $PSScriptRoot
7979 GITHUB_WORKSPACE = $env: GITHUB_WORKSPACE
8080 }
81+ $Path = Resolve-Path - Path $Path | Select-Object - ExpandProperty Path
8182 LogGroup " Invoke-ScriptAnalyzer -Path [$Path ] -Settings [$relativeSettingsFilePath ]" {
82- $script : testResults = Invoke-ScriptAnalyzer - Path $Path - Settings $SettingsFilePath - Recurse - Verbose
83+ $testResults = Invoke-ScriptAnalyzer - Path $Path - Settings $SettingsFilePath - Recurse - Verbose
8384 }
84- LogGroup " TestResults [$ ( $script : testResults.Count ) ]" {
85- $script : testResults | ForEach-Object {
85+ LogGroup " TestResults [$ ( $testResults.Count ) ]" {
86+ $testResults | ForEach-Object {
8687 $_ | Format-List | Out-String - Stream | ForEach-Object {
8788 Write-Verbose $_ - Verbose
8889 }
@@ -95,7 +96,7 @@ Describe 'PSScriptAnalyzer' {
9596 foreach ($rule in $rules | Where-Object - Property Severity -EQ $Severety ) {
9697 It " $ ( $rule.CommonName ) ($ ( $rule.RuleName ) )" - Skip:$rule.Skip - ForEach @ { Rule = $rule } {
9798 $issues = [Collections.Generic.List [string ]]::new()
98- $script : testResults | Where-Object - Property RuleName -EQ $Rule.RuleName | ForEach-Object {
99+ $testResults | Where-Object { $_ . RuleName -eq $Rule.RuleName } | ForEach-Object {
99100 $relativePath = $_.ScriptPath.Replace ($Path , ' ' ).Trim(' \' ).Trim(' /' )
100101 $issues.Add (([Environment ]::NewLine + " - $relativePath `:L$ ( $_.Line ) :C$ ( $_.Column ) " ))
101102 }
You can’t perform that action at this time.
0 commit comments