Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set $PSNativeCommandUseErrorActionPreference = $true in a workflow that uses pwsh #806

Merged
merged 13 commits into from
Sep 29, 2024
Merged
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