Capturing Output from Start-Process run in PowerShell to TeamCity Build log

I am running a PowerShell script from within TeamCity which calls an external process to execute using Start-Process as the following:

Write-Host "This is the command to be run:"
Write-Host """$SignToolExe""" $SignToolArgs
#Sign the Self-Extracting Executable
Start-Process $SignToolExe  $SignToolArgs -Verb runas -Verbose | Out-Host

However, TeamCity is not able to capture the output of the Console window when I run this external process.

Is there a way to alter my PowerShell script so that TeamCity can capture the console output of this process to the TeamCity Build log?

Please advise.

1 comment
Comment actions Permalink

Hi Samir,

TeamCity just print all output to the build log. Seems this question is not TeamCity related, but PowerShell. Please try the solution from stackoveflow:


Please sign in to leave a comment.