I have a Powershell workflow. I need to log data to Console so that the progress of the workflow is clearly visible. Till now I used Log-Verbose
to achieve this. When I execute this workflow with -Verbose
switch, verbose logs are displayed on the console as expected.
workflow Test-Workflow
{
Log-Verbose "Inside Test-Workflow"
}
Test-Workflow -Verbose
Now I need to use checkpoints inside the workflow. To take advantage of checkpoints, I need to run the workflow as a Job
.
Test-Workflow -Verbose -AsJob
When I do so, I no longer see the verbose logs on the console. I know I can write to a file or write the logs as events but I would really like to write them to the console. Let me know if this is possible and how.
I am sure you have discovered a solution to this by now but you can use:
According to MSDN: Write-Output: