-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-Consolethe console experiencethe console experience
Description
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)
pwsh -File Test.ps1
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"
steve-mt, pedropombeiro and mklement0
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Interactive-Consolethe console experiencethe console experience