Log a PowerShell Session to a File (Start-Transcript)
Capture every command and its output in a running PowerShell session into a timestamped log file.
01Command
$ Start-Transcript -Path "$env:USERPROFILE\Desktop\session.log"02What it does
Start-Transcript records everything that appears in the console — your commands, outputs, errors and even the header with machine details — until you call Stop-Transcript or close the window. It is the reliable way to keep evidence of a long troubleshooting session or to produce logs for a support ticket. Use -Append to add to an existing file instead of overwriting it.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Start-TranscriptEvidence: Documents Start-Transcript creating a transcript file of all session input and output, stopped by Stop-Transcript, with -Append to continue an existing file.
Last verified: 2026-09-18 · Category: Developer
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.