-
Notifications
You must be signed in to change notification settings - Fork 8.3k
CLI: -File arguments don't recognize [bool] parameter values when passed as separate arguments #10838
Copy link
Copy link
Closed
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
HacktoberfestPotential candidate to participate in HacktoberfestPotential candidate to participate in HacktoberfestIssue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
In response to #4036, passing Booleans to
[switch]parameters was fixed.However, the problem persists for
[bool]parameters if you pass the value as a separate argument (-param value), which is the typical syntax; by contrast,-param:value(the form that you must use with[switch]parameters) works fine (but using:and whitespace --param: value- is also broken).While
[bool]parameters are rare, there's no reason for them not to be supported.Additionally, the
-param: valuesyntax form (:separator and whitespace) also doesn't work with[switch]parameters, only-param:valuedoes (:, but no whitespace).Also, given that
[bool]parameters (but not[switch]parameters) also accepts numbers inside PowerShell - notably1for$trueand0for$false(e.g.,& { param([bool] $p) $p } 1yields$true) - passing numbers should be supported too.Steps to reproduce
Expected behavior
The test should pass.
Actual behavior
All tests except the ones with syntax form
-foo:$truefail:Environment data