Command line parsing bug: spaces and trailing slash
There appears to be a bug parsing arguments to EXEs. If you pass a properly-quoted path that has spaces and a trailing slash, the rest of the command is lumped into the same argument. This also happens if you use a PowerShell variable to hold the path string.
To repro, first, install EchoArgs.exe (if using chocolatey: cinst -y echoargs). It demonstrates what arguments would get passed to any exe.
PS> & EchoArgs "C:\spaces and trailing slash\" more args
Echo args shows that it all got lumped into one argument:
Arg 0 is <C:\spaces and trailing slash" more args>
If you remove the trailing slash, or the spaces, then it parses correctly ("more" and "args" are separate arguments):
PS> & EchoArgs "C:\noSpaces\Or\NoTrailingSlash" more args
Arg 0 is <C:\noSpaces\Or\NoTrailingSlash>
Arg 1 is <more>
Arg 2 is <args>
it's a property of EchoArgs and numerous other EXEs such as REG and FINDSTR. May be they are compiled from the same language that treats Argv the same way by default?
What happens if you use:
& EchoArgs "C:\spaces and trailing slash\\" more args
EchoArgs isn't part of Powershell proper (not v3 on Win 7, at least), so bugs/behaviour in EchoArgs might not be dealt with here.