Steps to reproduce
Link to a related Problem in GitLab:
https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27830#note_564599211
Test.ps1:
$ErrorActionPreference = 'Stop'
just bogus
Write-Host 'hello'
Batch-Call (working correctly with file)
Exit-Code: 1
Batch-Call (working correctly with stdin)
type Test.ps1 | pwsh -noprofile -noninteractive -command "$input | iex"
Exit-Code: 1
Batch-Call (not working correctly with stdin)
type Test.ps1 | pwsh -Command -
Exit-Code: 0
Expected behavior
Powershell quits with non zero exit code and does not print "hello", but an exception for "just bogus"
Actual behavior
Powershell does execute all statement even though $ErrorActionPreference is set to "stop"
Steps to reproduce
Link to a related Problem in GitLab:
https://gitlab.com/gitlab-org/gitlab-runner/-/issues/27830#note_564599211
Test.ps1:
Batch-Call (working correctly with file)
Exit-Code: 1
Batch-Call (working correctly with stdin)
Exit-Code: 1
Batch-Call (not working correctly with stdin)
Exit-Code: 0
Expected behavior
Actual behavior