开发者

Is there something odd with PowerShell and forwards slashes?

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜