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

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: http://stackoverflow.com/questions/8761888/powershell-capturing-standard-out-and-error-with-start-process.

0

Please sign in to leave a comment.