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) {
2626
2727if ($MyInvocation.ExpectingInput ) { # takes pipeline input
2828 $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
3030 & $NODE_EXE $NPM_CLI_JS $args
3131} else { # used "-Command" argument
3232 if (($MyInvocation | Get-Member - Name ' Statement' ) -and $MyInvocation.Statement ) {
@@ -40,9 +40,9 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
4040 $NODE_EXE = $NODE_EXE.Replace (" `` " , " ```` " )
4141 $NPM_CLI_JS = $NPM_CLI_JS.Replace (" `` " , " ```` " )
4242
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 ' '
4646
4747 Invoke-Expression " & `" $NODE_EXE `" `" $NPM_CLI_JS `" $NPM_ARGS "
4848}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (Test-Path $NPM_PREFIX_NPX_CLI_JS) {
2626
2727if ($MyInvocation.ExpectingInput ) { # takes pipeline input
2828 $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
3030 & $NODE_EXE $NPX_CLI_JS $args
3131} else { # used "-Command" argument
3232 if (($MyInvocation | Get-Member - Name ' Statement' ) -and $MyInvocation.Statement ) {
@@ -40,9 +40,9 @@ if ($MyInvocation.ExpectingInput) { # takes pipeline input
4040 $NODE_EXE = $NODE_EXE.Replace (" `` " , " ```` " )
4141 $NPX_CLI_JS = $NPX_CLI_JS.Replace (" `` " , " ```` " )
4242
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 ' '
4646
4747 Invoke-Expression " & `" $NODE_EXE `" `" $NPX_CLI_JS `" $NPX_ARGS "
4848}
You can’t perform that action at this time.
0 commit comments