To send the output of a PowerShell cmdlet to a file use Out-File.
Syntax:
.\pwrshl.ps1 | Out-File -FilePath .\my.log
Notes:
References:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-file