Dashes in front of external commands

by Sdedot at 2013-01-05 07:01:13


On page 45 of the POSH3 book, you state ‘Just add two dashes in front of any external command’. Im assuming this means two hyphens? I tried this with the Ping command and was not succussful. Could you please demonstrate a working example with the Ping command.

Thanks in advance.
by nohandle at 2013-01-05 11:48:30
What book are you refering to? I am not aware of such construction. – is decrement operator. Here is also --% stop parsing symbol but it also does not work if you start the if not preceded with anything.
by Infradeploy at 2013-01-06 05:19:53
isn’t test-conection good enough? :slight_smile:

ping just works with one dash in posh. (alliteration at it’s best)
by MattG at 2013-01-06 06:32:45
I believe what Don and Jeffery were referring to was adding ‘–%’ in between the command and its arguments telling PowerShell to not interpret those arguments. You’ll find an example here.
by Sdedot at 2013-01-06 17:33:49
Infradeploy: I do like Test-Connection and use it often. Just want to understand what Don/Jeff is referring to.

MattG: Thanks for the explanation and example.