#pwsh tip of the day! PowerShell has 6 streams: Output (1), Error (2), Warning (3), Verbose (4), Debug (5), and Info (6). Redirect with > or >>. Capture errors: 2> errors.txt, merge: 2>&1, silence: 2> $null, or grab all: *> all.txt. Happy Scripting!
about_Redirection - PowerShell
Explains how to redirect output from PowerShell to text files.
learn.microsoft.com