Skip to content
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

-CommandWithArgs CLI parameter doesn't work with - (code provided via stdin) #22891

Open
5 tasks done
mklement0 opened this issue May 9, 2024 · 0 comments
Open
5 tasks done
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.

Comments

@mklement0
Copy link
Contributor

mklement0 commented May 9, 2024

Prerequisites

Steps to reproduce

Note: To run the repro, experimental feature PSCommandWithArgs must be enabled.

'"Args: $args"' | pwsh -NoProfile -CommandWithArgs - foo bar

Note:

Expected behavior

Args: foo bar

Actual behavior

The CLI call fails:

'-' was specified with the -Command parameter; no other arguments to -Command are permitted.

That is, -CommandWithArgs unexpectedly behaves like -Command, even though there's no good reason to prevent this combination of arguments.

Error details

No response

Environment data

PowerShell 7.5.0-preview.2

Visuals

No response

@mklement0 mklement0 added the Needs-Triage The issue is new and needs to be triaged by a work group. label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage The issue is new and needs to be triaged by a work group.
Projects
None yet
Development

No branches or pull requests

1 participant