我想使用PowerShell、Psake和TeamCity来配置我的CI。以前我使用标准的Msbuild runner,但现在我编写了自己的构建脚本,但当Msbuild失败时出现问题。
在使用Msbuild runner时,如果构建失败,则“概览”页面上会出现新的“构建错误”部分,其中包含来自Msbuild的详细信息。但是,当我编写自定义脚本时,我只收到“进程退出代码1”的错误信息,我不知道如何“创建”此构建错误部分。你知道怎么做吗?我知道我可以使用服务消息,但我不能处理来自Msbuild的失败日志。
task compile {
try {
exec { msbuild $code_dir\SampleSolution.sln /t:Build /p:Configuration=Release }
} catch {
Write-Host $_ #only information that error occured, but without any msbui details
} }