Start-Transcript
Record the session to a log file
Start-Transcript -Path (Join-Path $env:TEMP 'ps-transcript.txt')
- Works on
- WindowsLinuxmacOS
- PowerShell
- 5.1 and later
- Reference
- Microsoft Learn: Start-Transcript
Logs input and output. Stop with Stop-Transcript. Put the file in $env:TEMP or a folder you chose. Do not log secrets. The companion script in this repo wraps a safer path.
Try this
Start-Transcript -Path (Join-Path $env:TEMP 'ps-transcript.txt')
Get-Date
Stop-Transcript
Coming from another shell
| Shell | What you might type |
|---|---|
| bash / zsh | script session.log |