PowerShell: send console output to file without deafening this console output PowerShell: send console output to file without deafening this console output powershell powershell

PowerShell: send console output to file without deafening this console output


You can use the tee equivalent of PowerShell : Tee-Object

PS: serverfault.com and/or superuser.com are more suitable for a question like this.


You can try Start-Transcript and Stop-Transcript. It has a couple of limitations like not capturing native exe output. It is also global to PowerShell session.


I've found script for grabbing console output: http://gallery.technet.microsoft.com/scriptcenter/e8fbffde-7d95-42d9-81de-5eb3d9c089e0. Script returns HTML to preserve colors.

The only big downside - you must call it at the end of your script to capture all console output it have made.