Start a transcript

Use Start-Transcript at the beginning of an interactive or controlled automation session. Choose a predictable log location.

Use structured filenames

Include the computer name, script name and timestamp in the filename so concurrent jobs do not overwrite one another.

Capture errors explicitly

Combine transcripts with structured error handling using try, catch and Write-Error. A transcript alone is not a replacement for error handling.

Secure the log location

Restrict access to transcript files because command output can contain environment details and operational data.

Stop cleanly

Use Stop-Transcript at the end of the session when you started the transcript manually.

Operational pattern

For scheduled jobs, combine transcript logs with event logging or a central log destination and implement retention.

More practical infrastructure guides

Browse the TechRunbook article library for Windows Server, VMware, Hyper-V, Azure, PowerShell and MABS troubleshooting.

Browse all articles →