You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(powershell): use Invoke-Expression to pass args (#8278)
Continuation of #8267@mbtools
---
This fixes the command `npm test -- hello -p1 world -p2 "hello world"
--q1=hello world --q2="hello world"` in Windows PowerShell and pwsh7
- where the "test" script prints all the arguments passed after the
first "--" in the command above
Before this change
```
PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world"
npm warn "world" is being parsed as a normal command line argument.
npm warn "hello world" is being parsed as a normal command line argument.
npm warn Unknown cli config "--p1". This will stop working in the next major version of npm.
npm warn Unknown cli config "--p2". This will stop working in the next major version of npm.
npm warn Unknown cli config "--q1". This will stop working in the next major version of npm.
npm warn Unknown cli config "--q2". This will stop working in the next major version of npm.
> [email protected] test
> node args.js hello world hello world world
hello
world
hello world
world
```
With this change
```
PS> npm test -- hello -p1 world -p2 "hello world" --q1=hello world --q2="hello world"
> [email protected] test
> node args.js hello -p1 world -p2 hello world --q1=hello world --q2=hello world
hello
-p1
world
-p2
hello world
--q1=hello
world
--q2=hello world
```
---
Also, fixes comma-separated values in Windows PowerShell and pwsh7
Before this change
```
PS> npm help a=1,b=2,c=3
No matches in help for: a=1 b=2 c=3
```
With this change
```
PS> npm help a=1,b=2,c=3
No matches in help for: a=1,b=2,c=3
```
0 commit comments