I use the transcript feature to help with this. Just include it in your code and it outputs all (would be) screen content to a log file.
Start-Transcript -path $LogFile -append
<Body of the script>
Stop-Transcript
I use the transcript feature to help with this. Just include it in your code and it outputs all (would be) screen content to a log file.
Start-Transcript -path $LogFile -append
<Body of the script>
Stop-Transcript