Update Variable in TeamCity powershell script Update Variable in TeamCity powershell script powershell powershell

Update Variable in TeamCity powershell script


Try

"##teamcity[setParameter name='env.currentBuildNumber' value='$newBuildNumber']"

(note the env. prefix in the name)

Also, you can try to increase the PowerShell std out column default (80 using TeamCity's command runner). If your service message is longer than that, then TeamCity will fail to parse it.

if ($env:TEAMCITY_VERSION) {    $host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(8192,50)}