Tip: Create a Transcript of What You Do in Windows PowerShell

Follow Our Daily Tips

Twitter | Blog | RSS | Facebook

The PowerShell console includes a transcript feature to help you record all your activities at the prompt. As of this writing, you cannot use this feature in the PowerShell application. Commands you use with transcripts include the following:

Start-transcript Initializes a transcript fi le and then creates a record of all subsequent actions in the PowerShell session. Use the following syntax:
Start-Transcript [[-path] FilePath] [-force] [-noClobber] [-append]

Stop-transcript Stops recording actions in the session and finalizes the transcript. Use the following syntax:
Stop-Transcript

You tell PowerShell to start recording your activities using the Start-Transcript cmdlet. This cmdlet creates a text transcript that includes all commands that you type at the prompt and all the output from these commands that appears on the console.

Here, FilePath specifies an alternate save location for the transcript file. Although you cannot use wildcards when you set the path, you can use variables. The directories in the path must exist or the command will fail.

The –Force parameter lets you override restrictions that prevent the command from succeeding. However, it will not modify security or change file permissions.

By default, if a transcript file exists in the specified path, Start-Transcript will overwrite the file without warning. The –noClobber parameter lets you prevent Windows PowerShell from overwriting an existing file.

And the –Append parameter will add the new transcript to the end of an existing file.

When you want to stop recording the transcript, you can either exit the console or type Stop-transcript. The Stop-Transcript cmdlet requires no additional parameters.

From the Microsoft Press book Windows PowerShell 2.0 Administrator’s Pocket Consultant by William R. Stanek.

Looking for More Tips?

For more tips on using Microsoft products and technologies, visit the TechNet Magazine Tips library.