How to redirect all output from a PowerShell script to a log file
October 1, 2021 0 Comments
The PowerShell script “My-Script.ps1” is just an example.
The *> will direct all output, including the output generated form scripts imported or executed from the “My-Script.ps1” itself.
.\My-Script.ps1 *> log.txt