Powershell Release Manager Output

395 Views Asked by At

I am working in a quite complex code base of powershell build scripts with a lot of dependencies on other PS scripts. Everything is dot-sourced, no module.

As we are refactoring the code into functions, a lot of issues are creeping up, mainly a liberal use of write-output for logging.

I try to enforce using write-verbose for logging, because the scripts will be deployed in release manager.

For some reason, as a build is executing, I don't see the verbose information. It is only shown afterwards when I inspect a specific step.

Write-Verbose usually outputs "Verbose:...." but in release manager I get "##[debug]Verbose" instead.

Is there a way to hide the [debug]Verbose prefix? Is there a better way to output logging info that would be shown in release manager?

2

There are 2 best solutions below

4
PatrickLu-MSFT On

This may due to you have enable Verbose Output in Team Foundation Release Logs

Navigate to the Variables tab and check if there is a variable named system.debug and its value set to true. If so, you will get a log with ##[debug] prefix such as below screenshot:

enter image description here

Set the value= false or directly delete the variable.

1
BenoitM On

Regarding the Verbose prefix, it was a bug in our code. I have found that the Write-Host output is shown in the web portal release log with TFS 2017. This was not the case in release manager 2015. Now we can use Write-Host to output info to the users.