-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix: ps1 scripts in powershell 5.1 #8469
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
Conversation
bcc017b
to
3ee2565
Compare
… mode is enabled.
3ee2565
to
4d90d3c
Compare
can we change if (($MyInvocation | Get-Member -Name 'Statement') -and $MyInvocation.Statement) { to if ($MyInvocation | Get-Member -Name 'Statement') { Otherwise, this PR looks good to me @wraithgar @mbtools |
Don't know how many people will run into this issue but it is in NodeJS 22.18.0+ / 24.3.0+ |
I think we should keep both. The first checks that the |
@splatteredbits Ok I understand the difference now |
Lgtm |
Fixes issue npm#8468: npm.ps1 and npx.ps1 fail on Windows PowerShell 5.1 when run in strict mode.
Fixes issue #8468: npm.ps1 and npx.ps1 fail on Windows PowerShell 5.1 when run in strict mode.
References