Shell 术语“Win32”无法识别为cmdlet的名称-请将管道符号作为参数的一部分传递
我正在尝试为自动化构建创建脚本。 发布时堆叠| Win32命令 命令:Shell 术语“Win32”无法识别为cmdlet的名称-请将管道符号作为参数的一部分传递,shell,powershell,command-line-interface,quotes,quoting,Shell,Powershell,Command Line Interface,Quotes,Quoting,我正在尝试为自动化构建创建脚本。 发布时堆叠| Win32命令 命令: PS C:\Users\Builder> powershell.exe "& 'C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com'" C:\Build\ VS2012Build\3.2.7X\ClientServer\SHClientServer\SHCApplicationsVS2012.sln /Clean Releas
PS C:\Users\Builder> powershell.exe "& 'C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com'" C:\Build\
VS2012Build\3.2.7X\ClientServer\SHClientServer\SHCApplicationsVS2012.sln /Clean Release|Win32 No Local
错误:
The term 'Win32' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spell
ing of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:193
+ powershell.exe "& 'C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com'" C:\Build\VS2012Build\3.2.7X
\ClientServer\SHClientServer\SHCApplicationsVS2012.sln /Clean Release|Win32 <<<< No Local
+ CategoryInfo : ObjectNotFound: (Win32:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
由于|是元字符,在PowerShell中是具有语法意义的字符,因此如果要将其用作参数的一部分,则必须引用它-可以单独使用`或更典型地通过单引号或双引号引用整个参数:
powershell.exe "& 'C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.com' C:\Build\VS2012Build\3.2.7X\ClientServer\SHClientServer\SHCApplicationsVS2012.sln /Clean 'Release|Win32' No Local"
请注意,Release | Win32现在是单引号“Release | Win32”。
另外,我已将整个PowerShell命令包含在。。。对于健壮性。
很高兴听到这有帮助,@Vlad;我的荣幸。