How can I set the build status of TeamCity from Powershell?

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

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

      

It works great when running as a cmd; however, I need to do this in a Powershell script. Can someone point me in the right direction? I've tried this as-in Powershell, but the pound sign acts like a comment.

Thank.

+3


source to share


3 answers


#

sing is the start of a single line comment, you must make it a regular line. Just put it in quotes:



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

      

+6


source


I found my answer. It works great! I just missed the quotes around everything:



Here is the solution to my problem

+1


source


After version 7.1 you can use buildProblem to report a bug and it will display the rejection text instead of just "exit 1"

"## teamcity [buildProblem description = 'A custom url has been tied to SVN']"

0


source







All Articles