I have a script that is being called a certain way, i cannot change it. I want to redirect the error messages from the entire script to a file. How does this work?
I did this, which works, except the errors are complete gone:
$ErrorActionPreference="SilentlyContinue"
Start-Transcript -path C:\output.txt -append
write-host "test"
some nonsence that creates as error
Stop-Transcript
Thanks
Start-Transcript? What is the certain way your script is being called? Is it aps1being called from the command line?