Skip to content

Commit 05d4d9b

Browse files
committed
Updated Test to validate the fix
1 parent 16dd47a commit 05d4d9b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Tests/Rules/AvoidPositionalParametersNoViolations.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ Clear-Host
44
Split-Path -Path "Random" -leaf
55
Get-Process | Where-Object {$_.handles -gt 200}
66
get-service-computername localhost | where {($_.status -eq "Running") -and ($_.CanStop -eq $true)}
7-
1, 2, $null, 4 | ForEach-Object {"Hello"}
7+
1, 2, $null, 4 | ForEach-Object {"Hello"}
8+
& "$env:Windir\System32\Calc.exe" Parameter1 Parameter2
9+
10+
# There was a bug in Positional Parameter rule that resulted in the rule being fired
11+
# when using external application with absolute paths
12+
# The below function is to validate the fix - rule must not get triggered
13+
function TestExternalApplication
14+
{
15+
& "c:\Windows\System32\Calc.exe" parameter1
16+
}

0 commit comments

Comments
 (0)