STORM
STORM

Reputation: 4341

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.

Upvotes: 3

Views: 2782

Answers (1)

mklement0
mklement0

Reputation: 439058

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.

Upvotes: 6

Related Questions