Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show Visual Studio Online build task Write-Verbose statements?

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?

like image 908
Jeremy Avatar asked Jun 27 '15 19:06

Jeremy


People also ask

Why would you use the write verbose parameter and when?

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.

How do I enable verbose in PowerShell?

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.


2 Answers

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.

like image 123
Chris Patterson Avatar answered Oct 13 '22 03:10

Chris Patterson


Here's what worked for me:

  1. Use Write-Verbose "Text" -Verbose inside your script
  2. Assign build variable system.debug to true
like image 42
abatishchev Avatar answered Oct 13 '22 04:10

abatishchev