Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there something odd with PowerShell and forwards slashes?

Tags:

powershell

As far as I know, a forward slash is not a reserved keyword in PowerShell. But running the following in cmd pops up an about dialog

"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:about

The same in PowerShell gives:

'C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe' /command:about

You must provide a value expression on the right-hand side of the '/' operator.
At line:1 char:54
+ 'C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe' /c <<<< ommand:about

What gives?

like image 696
George Mauer Avatar asked Nov 03 '09 16:11

George Mauer


1 Answers

Put an ampersand character in front of the command

&"C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" /command:about

Otherwise, it thinks you're trying to divide the string literal "C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe" by something, but it doesn't know by what.

like image 158
configurator Avatar answered Nov 20 '22 13:11

configurator