-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add -CommandWithArgs parameter to pwsh
#18726
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
Add -CommandWithArgs parameter to pwsh
#18726
Conversation
src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
Outdated
Show resolved
Hide resolved
michaeltlombardi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a minor note about the existing docs to fix a typo and some grammar. Looking over the PR, do I understand correctly that this parameter works even if the experimental feature isn't enabled?
Follow up questions, if that's the case:
- Should the parameter documentation itself note that this is experimental functionality, especially since it may be removed in the future?
- This documentation is shown at the command line even when the feature isn't enabled, correct?
src/Microsoft.PowerShell.ConsoleHost/resources/ManagedEntranceStrings.resx
Show resolved
Hide resolved
…eterParser.cs Co-authored-by: Ilya <darpa@yandex.ru>
src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs
Outdated
Show resolved
Hide resolved
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@SteveL-MSFT I believe new experimental features should be added to the following files: https://github.com/PowerShell/PowerShell/blob/master/experimental-feature-windows.json
|
|
🎉 Handy links: |
PR Summary
There are situations where you want to run a PS pipeline from
pwsh -c, but need to provide arguments. This adds a new-CommandWithArgsparameter where the first string is the command and subsequent space delimited strings are arguments.This is advertised as an Experimental Feature, but is not code fenced. It reuses the arg parsing logic as
-Fileso that switch parameters can be turned off. This makes the diff look a bit more complex than it is as the arg parsing code was moved fromParseFile()to a separateCollectPSArgs()method.PR Context
Fix #15417
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.PSCommandWithArgs-CommandWithArgsparam for pwsh MicrosoftDocs/PowerShell-Docs#9529(which runs in a different PS Host).