3

I am trying to set the status of a Team City build from Powershell. I found how to do it from Windows cmd:

##teamcity[buildStatus status='FAILURE' text='A non-standard URL has been committed to SVN']
EXIT 1

It works perfectly when running as a cmd; however, I have a need to do this in a Powershell script. Can anyone point me in the right direction? I tried it as-is in Powershell, but the pound sign acts like a comment.

Thanks.

Wayne
  • 109
  • 4
  • 9

3 Answers3

8

The # sing is start of the single line comment, you have to make it regular string. Just put it into quotes:

"##teamcity[buildStatus status='FAILURE' text='A non-standard URL has been committed to SVN']"
exit 1
Aleš Roubíček
  • 5,198
  • 27
  • 29
1

I found my answer. It works great! I was simply missing quotes around the whole thing:

Here is the solution to my issue

Community
  • 1
  • 1
Wayne
  • 109
  • 4
  • 9
0

After Version 7.1, you can use buildProblem to report a failure and it will display the failure text instead of just "exit 1"

"##teamcity[buildProblem description='A non-standard URL has been committed to SVN']"

faddison
  • 101
  • 1
  • 6