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 1
1
# !/usr/bin/env pwsh
2
2
3
+ Set-StrictMode - Version ' Latest'
4
+
3
5
$NODE_EXE = " $PSScriptRoot /node.exe"
4
6
if (-not (Test-Path $NODE_EXE )) {
5
7
$NODE_EXE = " $PSScriptRoot /node"
@@ -27,7 +29,7 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
27
29
} elseif (-not $MyInvocation.Line ) { # used "-File" argument
28
30
& $NODE_EXE $NPM_CLI_JS $args
29
31
} else { # used "-Command" argument
30
- if ($MyInvocation.Statement ) {
32
+ if (( $MyInvocation | Get-Member - Name ' Statement ' ) -and $MyInvocation.Statement ) {
31
33
$NPM_ORIGINAL_COMMAND = $MyInvocation.Statement
32
34
} else {
33
35
$NPM_ORIGINAL_COMMAND = (
Original file line number Diff line number Diff line change 1
1
# !/usr/bin/env pwsh
2
2
3
+ Set-StrictMode - Version ' Latest'
4
+
3
5
$NODE_EXE = " $PSScriptRoot /node.exe"
4
6
if (-not (Test-Path $NODE_EXE )) {
5
7
$NODE_EXE = " $PSScriptRoot /node"
@@ -27,7 +29,7 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
27
29
} elseif (-not $MyInvocation.Line ) { # used "-File" argument
28
30
& $NODE_EXE $NPX_CLI_JS $args
29
31
} else { # used "-Command" argument
30
- if ($MyInvocation.Statement ) {
32
+ if (( $MyInvocation | Get-Member - Name ' Statement ' ) -and $MyInvocation.Statement ) {
31
33
$NPX_ORIGINAL_COMMAND = $MyInvocation.Statement
32
34
} else {
33
35
$NPX_ORIGINAL_COMMAND = (
You can’t perform that action at this time.
0 commit comments