File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (Test-Path $NPM_PREFIX_NPM_CLI_JS) {
26
26
27
27
if ($MyInvocation.ExpectingInput ) { # takes pipeline input
28
28
$input | & $NODE_EXE $NPM_CLI_JS $args
29
- } elseif (-not $MyInvocation.Line -or $MyInvocation .InvocationName -in ' & ' , ' . ' ) { # used "-File" argument
29
+ } elseif (-not $MyInvocation.Line ) { # used "-File" argument
30
30
& $NODE_EXE $NPM_CLI_JS $args
31
31
} else { # used "-Command" argument
32
32
if (($MyInvocation | Get-Member - Name ' Statement' ) -and $MyInvocation.Statement ) {
@@ -40,9 +40,9 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
40
40
$NODE_EXE = $NODE_EXE.Replace (" `` " , " ```` " )
41
41
$NPM_CLI_JS = $NPM_CLI_JS.Replace (" `` " , " ```` " )
42
42
43
- $NPM_NO_REDIRECTS_COMMAND = [Management.Automation.Language.Parser ]::ParseInput($NPM_ORIGINAL_COMMAND , [ref ] $null , [ref ] $null ).
44
- EndBlock.Statements.PipelineElements.CommandElements.Extent.Text -join ' '
45
- $NPM_ARGS = $NPM_NO_REDIRECTS_COMMAND .Substring ( $MyInvocation .InvocationName.Length ).Trim()
43
+ $NPM_COMMAND_ARRAY = [Management.Automation.Language.Parser ]::ParseInput($NPM_ORIGINAL_COMMAND , [ref ] $null , [ref ] $null ).
44
+ EndBlock.Statements.PipelineElements.CommandElements.Extent.Text
45
+ $NPM_ARGS = ( $NPM_COMMAND_ARRAY | Select-Object - Skip 1 ) -join ' '
46
46
47
47
Invoke-Expression " & `" $NODE_EXE `" `" $NPM_CLI_JS `" $NPM_ARGS "
48
48
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (Test-Path $NPM_PREFIX_NPX_CLI_JS) {
26
26
27
27
if ($MyInvocation.ExpectingInput ) { # takes pipeline input
28
28
$input | & $NODE_EXE $NPX_CLI_JS $args
29
- } elseif (-not $MyInvocation.Line -or $MyInvocation .InvocationName -in ' & ' , ' . ' ) { # used "-File" argument
29
+ } elseif (-not $MyInvocation.Line ) { # used "-File" argument
30
30
& $NODE_EXE $NPX_CLI_JS $args
31
31
} else { # used "-Command" argument
32
32
if (($MyInvocation | Get-Member - Name ' Statement' ) -and $MyInvocation.Statement ) {
@@ -40,9 +40,9 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
40
40
$NODE_EXE = $NODE_EXE.Replace (" `` " , " ```` " )
41
41
$NPX_CLI_JS = $NPX_CLI_JS.Replace (" `` " , " ```` " )
42
42
43
- $NPX_NO_REDIRECTS_COMMAND = [Management.Automation.Language.Parser ]::ParseInput($NPX_ORIGINAL_COMMAND , [ref ] $null , [ref ] $null ).
44
- EndBlock.Statements.PipelineElements.CommandElements.Extent.Text -join ' '
45
- $NPX_ARGS = $NPX_NO_REDIRECTS_COMMAND .Substring ( $MyInvocation .InvocationName.Length ).Trim()
43
+ $NPX_COMMAND_ARRAY = [Management.Automation.Language.Parser ]::ParseInput($NPX_ORIGINAL_COMMAND , [ref ] $null , [ref ] $null ).
44
+ EndBlock.Statements.PipelineElements.CommandElements.Extent.Text
45
+ $NPX_ARGS = ( $NPX_COMMAND_ARRAY | Select-Object - Skip 1 ) -join ' '
46
46
47
47
Invoke-Expression " & `" $NODE_EXE `" `" $NPX_CLI_JS `" $NPX_ARGS "
48
48
}
You can’t perform that action at this time.
0 commit comments