Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8721181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:10:43+00:00 2026-06-13T07:10:43+00:00

How do I get TeamCity to output messages in the build log with Powershell?

  • 0

How do I get TeamCity to output messages in the build log with Powershell?

I am using TeamCity 7.1.

Here is my Powershell Build Step:enter image description here

The script is:

write-host "##teamcity[message 'Getting production info']"

if ($LASTEXITCODE -ne 0) {
    write-host "##teamcity[message 'Production Remote Not Found: Creating Remote']"

    write-host "##teamcity[message 'Pushing to Remote']"
    #git push production

} else {
    write-host "##teamcity[message 'write-output: Production Remote Found: Pushing to Remote']"
    #git push production
}

And the only thing I am getting in the build log is:

[17:02:58]Skip checking for changes - changes are already collected
[17:02:59]Publishing internal artifacts (1s)
[17:03:00][Publishing internal artifacts] Sending build.start.properties.gz file
[17:02:59]Clearing temporary directory: C:\BuildAgent2\temp\buildTmp
[17:02:59]Checkout directory: C:\BuildAgent2\work\7669b6a04f96908d
[17:02:59]Updating sources: agent side checkout
[17:02:59][Updating sources] VCS Root: Portal Master
[17:02:59][VCS Root: Portal Master] revision: c5c6a9a0d491ee2c64ce98e48b0d67c422237698
[17:02:59][VCS Root: Portal Master] Resetting Portal Master in C:\BuildAgent2\work\7669b6a04f96908d to revision c5c6a9a0d491ee2c64ce98e48b0d67c422237698
[17:02:59]Starting: C:\Windows\sysnative\cmd.exe /c C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -File C:\BuildAgent2\temp\buildTmp\powershell1349912883332714566.ps1
[17:02:59]in directory: C:\BuildAgent2\work\7669b6a04f96908d
[17:03:00]
[17:03:00]
[17:03:00]
[17:03:00]Process exited with code 0
[17:03:00]Publishing internal artifacts
[17:03:00][Publishing internal artifacts] Sending build.finish.properties.gz file
[17:03:00]Build finished
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:10:44+00:00Added an answer on June 13, 2026 at 7:10 am

    As described in documentation “message” service message can have multiple arguments, so you need to specify at least argument ‘text’: "##teamcity[message text='Getting production info']"

    Your script will be

    write-host "##teamcity[message text='Getting production info']"
    
    if ($LASTEXITCODE -ne 0) {
        write-host "##teamcity[message text='Production Remote Not Found: Creating Remote']"
    
        write-host "##teamcity[message text='Pushing to Remote']"
        #git push production
    
    } else {
        write-host "##teamcity[message text='write-output: Production Remote Found: Pushing to Remote']"
        #git push production
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get a build process set up in TeamCity 5, and
I want to adjust the output from my TeamCity build configuration of my class
I am using TeamCity to build a .NET product. I'd like to take all
I use teamcity to build Sharepoint projects using 64-bit MSBuild. All projects work fine
i'm using teamcity 5.1.5.. trying to build an MSBuild project with an AfterDeploy target
I am trying to get SpecUnit to run in a continuous integration build using
Using TeamCity, I'm trying to get a (TestAutomationFX) test that requires an STA thread
I'm currently slugging it out with TeamCity trying to get two build configuration working
I get an error on my unit test and it hangs my TeamCity continuous
I have a MSBuild script that I am executing through TeamCity. One of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.