Skip to content

Commit

Permalink
Set $PSNativeCommandUseErrorActionPreference = $true in a workflow …
Browse files Browse the repository at this point in the history
…that uses pwsh (#806)

Fixes GH-617
  • Loading branch information
kachick authored Sep 29, 2024
1 parent 65ff559 commit b395697
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,19 @@ permissions:

defaults:
run:
shell: pwsh
# To respect exit code and make fail-fast behaviors. See GH-617
shell: |
pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'"
jobs:
inspect_runner:
runs-on: windows-2022
steps:
- name: Print some variables which is applied in GH-617
run: |
$PSVersionTable
$PSNativeCommandUseErrorActionPreference
$ErrorActionPreference
# This job has many comment-out tyle note, agree to ugly, but do NOT remove for now.
# See #443 for detail.
#
Expand Down

0 comments on commit b395697

Please sign in to comment.