Many Visual Studio Online (VSO) build tasks use Write-Verbose for debugging purposes as seen in this example, but how do you turn Write-Verbose on so that the debug statements appear in the output logs?
The Write-Verbose cmdlet writes text to the verbose message stream in PowerShell. Typically, the verbose message stream is used to deliver more in depth information about command processing.
The very first line of your question clearly and concisely agrees with these. But verbose in PowerShell is different. In a nutshell, turning on verbose mode (be it with the -Verbose command line switch or the $VerbosePreference variable) simply enables output from the verbose stream to the console.
To get verbose and debug statements to show up in the log you simply need to add the System.Debug variable to the variables on your definition.
Here's what worked for me:
Write-Verbose "Text" -Verbose
inside your scriptsystem.debug
to true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With