-
Notifications
You must be signed in to change notification settings - Fork 3.6k
fix(powershell): improve argument parsing #8539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
OK PR is ready now |
We're getting more cases that aren't covered by tests. However, the Windows Shims Test is already taking over 7 min. It loops over 7 shells (times 6 tests). Either the test itself needs a performance improvement, or we should have a separate test just for PowerShell that covers the recently added cases. |
The first one is required if you don't want to include the call (&) operator It's also better code in this PR since we used to assume InvocationName was always in the command and that isn't true |
looks good |
Made a minor variable name change |
improve the argument parsing PS1 logic - support `& npm args` and `. npm args` properly - support syntax such as `C:\"Program Files"\nodejs\npm.ps1 args` **of course ^ for both npm and npx version of the script** Code Explanation: instead of getting the `CommandElements.Extent.Text` array and joining it with spaces right away, now it's getting the same array and only capturing everything after the first element
improve the argument parsing PS1 logic
& npm args
and. npm args
properlyC:\"Program Files"\nodejs\npm.ps1 args
of course ^ for both npm and npx version of the script
Code Explanation: instead of getting the
CommandElements.Extent.Text
array and joining it with spaces right away, now it's getting the same array and only capturing everything after the first element@wraithgar @mbtools sorry about this right after the other PR