File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11# !/usr/bin/env pwsh
22
3+ Set-StrictMode - Version ' Latest'
4+
35$NODE_EXE = " $PSScriptRoot /node.exe"
46if (-not (Test-Path $NODE_EXE )) {
57 $NODE_EXE = " $PSScriptRoot /node"
@@ -27,7 +29,7 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
2729} elseif (-not $MyInvocation.Line ) { # used "-File" argument
2830 & $NODE_EXE $NPM_CLI_JS $args
2931} else { # used "-Command" argument
30- if ($MyInvocation.Statement ) {
32+ if (( $MyInvocation | Get-Member - Name ' Statement ' ) -and $MyInvocation.Statement ) {
3133 $NPM_ORIGINAL_COMMAND = $MyInvocation.Statement
3234 } else {
3335 $NPM_ORIGINAL_COMMAND = (
Original file line number Diff line number Diff line change 11# !/usr/bin/env pwsh
22
3+ Set-StrictMode - Version ' Latest'
4+
35$NODE_EXE = " $PSScriptRoot /node.exe"
46if (-not (Test-Path $NODE_EXE )) {
57 $NODE_EXE = " $PSScriptRoot /node"
@@ -27,7 +29,7 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
2729} elseif (-not $MyInvocation.Line ) { # used "-File" argument
2830 & $NODE_EXE $NPX_CLI_JS $args
2931} else { # used "-Command" argument
30- if ($MyInvocation.Statement ) {
32+ if (( $MyInvocation | Get-Member - Name ' Statement ' ) -and $MyInvocation.Statement ) {
3133 $NPX_ORIGINAL_COMMAND = $MyInvocation.Statement
3234 } else {
3335 $NPX_ORIGINAL_COMMAND = (
You can’t perform that action at this time.
0 commit comments