It seems that somebody has subtly changed the way that parameter switches are parsed on powershell. On some machines “split-path c:\x\y –parent” works. On some it fails. Can anyone tell me a) what causes the difference and b) how can I stop it?
It seems that somebody has subtly changed the way that parameter switches are parsed
Share
Switch parameters should work in the same way in both V1 and V2 (that means
-parentis the right syntax).In your case
--parentshould be bound to an parameter as a string. It should not be interpreted as a switch. You can test the binding viaTrace-CommandFurther info:
Considering
--: every string behind--is interpreted as argument, no matter if it looks like a switch.