-
New Feature
-
Resolution: Unresolved
-
Minor
Consider this declarative pipeline:
pipeline { agent any stages { stage('Deploy') { steps { powershell 'Write-Verbose \'This is the verbose stream\'' powershell 'Write-Information \'This is the info stream\'' } } } }
The console output looks like this:
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Deploy)
[Pipeline] powershell[microservice-helpers] Running PowerShell script
[Pipeline] powershell[microservice-helpers] Running PowerShell script
This is the info stream
[Pipeline] }
[Pipeline] // stage
Notice that the verbose stream is not written to the console. I propose a new flag for the powershell step, which would allow user-selected streams (such as Verbose and Debug) to be output to console.
To get these streams in powershell, it is generally only necessary to use the common parameters -Debug and -Verbose when calling the script. See this link for more information:
Another way to trigger output of the verbose stream is to set $VerbosePreference = 'Continue' at a global level in the shell before running the actual script.
See also this blog post on streams in powershell: