I have a simple script which writes to the console multiple times over a range of time:
foreach ($i in 0…5)
Write-Host “start of $i”
Write-Host “end of $i”
In the Task Log, none of the output shows up until the step is finished.
I have tried it with Write-Host, Write-Output, Write-Highlight, Write-Wait, and Write-Warning.
I have tried adding [Console]::Out.Flush().
But I still don’t get to see any of the output in the Task Log until the step is completely finished.
Is there any way to see console output in real time?