Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Powershell 如何在TeamCity的概览页面上显示msbuild错误_Powershell_Psake_Teamcity 7.1 - Fatal编程技术网

Powershell 如何在TeamCity的概览页面上显示msbuild错误

Powershell 如何在TeamCity的概览页面上显示msbuild错误,powershell,psake,teamcity-7.1,Powershell,Psake,Teamcity 7.1,我想将PowerShell与Psake和TeamCity一起使用来配置我的CI。我以前使用标准的Msbuild运行程序,但现在我为构建解决方案编写了自己的脚本,但当Msbuild失败时,我遇到了问题 当我使用Msbuild runner时,生成失败,然后在概览页面上出现新的“生成错误”部分,我有来自Msbuild的详细信息。但当我编写自定义脚本时,我只得到了一个错误“processexittedwithcode1”,我不知道如何“创建”这个构建错误部分。你知道怎么做吗?我知道我可以使用,但我无法

我想将PowerShell与Psake和TeamCity一起使用来配置我的CI。我以前使用标准的Msbuild运行程序,但现在我为构建解决方案编写了自己的脚本,但当Msbuild失败时,我遇到了问题

当我使用Msbuild runner时,生成失败,然后在概览页面上出现新的“生成错误”部分,我有来自Msbuild的详细信息。但当我编写自定义脚本时,我只得到了一个错误“processexittedwithcode1”,我不知道如何“创建”这个构建错误部分。你知道怎么做吗?我知道我可以使用,但我无法处理来自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
} }
您可以指定

分析日志中的错误或将整个日志附加为构建工件

##teamcity[publishArtifacts '.\msbuild.log']
要使构建失败,可以使用以下消息

Write-Output "##teamcity[message text='MS Build failed' status='ERROR']"

您可以获取所有可使用的消息

您有权访问生成日志文件吗?Msbuild build log-yesHere是一个非常好的解决方案: