I would like to disable the "general options" PowerShell for one of my functions. I worked on a set of extensions for p4.exe (Perforce command line utility), writing a function something like this:
function p4(
[parameter(valuefromremainingarguments=1)]
[string[]]$cmdline)
{
p4.exe $cmdline
}
The bottom line is to be able to use p4 in the same way as I usually do on the command line, except that sometimes some parameters will be processed magically (add new commands or call different tools or something else), and there will always be as if I'm just using the regular p4 command line.
This works very well until I start using a parameter like '-o'.
p4 -p 1666 user -o scobi
In this case, I get an error from PowerShell:
p4 : Parameter cannot be processed because the parameter name 'o' is ambiguous. Possible matches include: -OutVariable -OutBuffer.
, , - :
p4 -p 1666 user '-o' scobi
p4 '-p 1666 user -o scobi'
Yucky, p4.exe.
, , " "? ?