If you look at documentation and examples about output redirection in Powershell, you'll often find code showing you how to redirect e.g. Write-Warning on the command line level like shown here:
.\script.ps1 3> warnings.log
Usually, it's best practi...