【发布时间】:2010-10-01 09:33:40
【问题描述】:
看来我可以使用单引号或双引号转义命令行参数:
PS C:\> echo Hello World
Hello
World
PS C:\> echo 'Hello World'
Hello World
PS C:\> echo "Hello World"
Hello World
但我仍然无法弄清楚,那就是当您希望从包含空格的目录中运行可执行文件时:
PS C:\> c:\program files\test.exe
The term 'c:\program' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.
At line:1 char:11
+ c:\program <<<< files\test.exe
PS C:\> 'c:\program files\test.exe'
c:\program files\test.exe
PS C:\> "c:\program files\test.exe"
c:\program files\test.exe
PS C:\>
如何让 PowerShell 运行上面的可执行文件?
【问题讨论】:
标签: powershell