How to redirect all output from a PowerShell script to a log file
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