【发布时间】:2011-12-26 14:21:10
【问题描述】:
我正在尝试使用 Powershell 通过命令行参数 ($args[0]) 传递属性,如下所示,但没有考虑。
if ( Test-path -path $args[0]) {
&"$MsbuildBinPath\Msbuild.exe" $MSBuildFile /t:BuildAll "/p:AllComponents=$args[0]" $Logger $ErrorLogger
if ($LastExitCode -ne 0) {
Write-Host "It failed, send a mail"
}
}
如果我像下面这样传递属性,则正在考虑中。
"/p:AllComponents=List.txt"
为什么直接应用命令行参数时不考虑它?
我可以将命令行值存储在某个变量中并传递,但是有没有其他机制可以直接传递它?
【问题讨论】:
标签: powershell msbuild powershell-2.0 msbuild-4.0