【发布时间】:2015-01-02 01:45:39
【问题描述】:
我目前正在调整我的 msbuild 文件以进行持续集成。更具体地说,在Microsoft official help 的指导下,我尝试在msbuild 文件中调用powershell 在远程服务器上执行任务。一切都很棒,除了“&”在 msbuild 文件中不会被“&”替换。例如,
<Exec Command="powershell.exe -NonInteractive -executionpolicy Unrestricted
-command "& invoke-command
-Computername 'RemoteServer'
-scriptblock {...}
""/>
上面包含的msbuild脚本执行时,命令翻译为
powershell.exe -NonInteractive -executionpolicy Unrestricted
-command "& invoke-command
-Computername 'RemoteServer'
-scriptblock {...}
"
如您所见,“”和“’”已成功翻译,而“&”不是。
非常感谢任何线索!
【问题讨论】:
标签: xml powershell msbuild escaping