[英]Validating result from previous build step in TFS build 2015
Using TFS build 2015, I'm looking for a way to validate the outcome of the previous build steps. 使用TFS build 2015,我正在寻找一种方法来验证先前构建步骤的结果。
The scenario I'm looking for is that, from a powershell script triggered as a build step, be able to loop through the previous build steps and being able to validate if any of them failed. 我正在寻找的场景是,从作为构建步骤触发的Powershell脚本中,能够遍历先前的构建步骤,并能够验证其中任何一个是否失败。
I want the previous steps to be unaware of the validation. 我希望前面的步骤不知道验证。 I dont want the previous steps to have to set the status of their outcome.
我不希望前面的步骤必须设置其结果的状态。
Thanks! 谢谢!
I don't think it will be possible to validate previous build steps without having them return a state to TFS. 我认为如果不让先前的构建步骤将状态返回给TFS,就无法验证它们。 But you can set variables from a PowerShell script by writing
##vso[task.setvariable]value
to the output as described here which you can later check in a following PowerShell script. 但是你可以通过编写设定从PowerShell脚本变量
##vso[task.setvariable]value
作为描述的输出在这里 ,你可以在下面的PowerShell脚本后检查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.