Logging PowerShell Sessions

by Apr 7, 2016

PowerShell always supported session logging in the PowerShell console. Simply enter Start-Transcript to log all input and output to a text file. This cmdlet did not work in the PowerShell ISE, though.

Beginning with PowerShell 5.0, Start-Transcript can be used in any host, including the PowerShell ISE. If you do not specify a log file path, PowerShell picks one for you:

PS> Start-Transcript
Transcript started, output file is C:\Users\Tobias\Documents\PowerShell_transcript.DELL1.k6lOKL5u.20160330074900


Logging continues until you either close the host, or enter Stop-Transcript.

Twitter This Tip! ReTweet this Tip!