Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically save PowerShell session

How can i redirect everything what happens within a PowerShell windows (inputs and outputs) automatically to a file? I don't mean single commands instead i would like to have something like a logger which captures everything and logs into a local file so that i have a history of things done within the powershell window.

like image 475
STORM Avatar asked Apr 12 '26 13:04

STORM


1 Answers

You're looking for PowerShell's Start-Transcript cmdlet, which:

creates a record of all or part of a Windows PowerShell session to a text file. The transcript includes all command that the user types and all output that appears on the console.

Running transcripts must be stopped explicitly, with the Stop-Transcript cmdlet.

like image 147
mklement0 Avatar answered Apr 15 '26 02:04

mklement0



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!