Fix implicit remoting proxy cmdlets to act on common parameters (#20367)

This commit is contained in:
Steve Lee
2023-09-26 16:07:00 -07:00
committed by GitHub
parent be4494938a
commit 9ebeca3d6e
2 changed files with 23 additions and 2 deletions
@@ -1532,4 +1532,15 @@ Describe "WinCompat importing should check availablity of built-in modules" -Tag
$result[4] | Should -BeExactly 'ConvertFrom-String'
$result[5] | Should -BeExactly 'CFS'
}
It 'ErrorAction should be used for cmdlet' {
try {
$out = Invoke-Expression 'get-AppLockerFileInformation NoSuch.exe -ErrorAction Stop; "after"'
}
catch {
# do nothing as we expect an error, but execution should not continue
}
$out | Should -Not -Contain 'after'
}
}