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
{{ message }}
Repository navigation
Switch with coloned value parsed differently when invoking with pass thru args #6492
Steve Lee (@SteveL-MSFT), this is our production code and i have reduced and anonymize it to demonstrate the problem. External party (Visual Studio in our case) calls a.ps1 with -p1:$true, so we don't control that part. The only viable solution is to move code from b.ps1 to a.ps1. In our case, that means a lots of duplicate code.
is this a bug with PowerShell argument parsing, splatting or parameter binding? Please share if there is a workaround that can be made in a.ps1 or b.ps2 without raising our expectation from the caller.
Activity
mklement0 commentedon Mar 25, 2018
kasper3: I think this is a duplicate of #6360 and part of larger discussion about parameter parsing (#6467).
mklement0 commentedon Mar 25, 2018
kasper3:
The workaround is to define the same
param()block ina.ps1and then pass@PSBoundParametersthrough instead of@args.Of course, if you need to support unknown-in-advance parameters to pass through, that won't work.