I have a Powershell script for which I would like to redirect the output to a file. The problem is that I cannot change the way this script is called. So I cannot do:
.\MyScript.ps1 > output.txt
How to redirect the output of a Powershell script during its execution?
Thanks!