SharePoint Tip: Next time you are in record your commands to a text file for future use.

PowerShell is a very powerful tool for deploying and configuring SharePoint. Sometimes getting the commands right can take some time and the script may need to run on another environment. Recording your PowerShell scripts to a text file can help you create scripts for future use. Below are the commands to record and stop recording a PowerShell script.

Start-Transcript

There are two ways to start recording a PowerShell session as seen below:

start-transcript

This command starts a transcript in the default file location.

or

start-transcript -path c:scriptsscript1.txt

This command starts a transcript in the script1.txt file in C:scripts.

Stop-Transcript

To stop recording a PowerShell session run the following command:

stop-transcript

This command stops any running transcripts.

For more information on the Start-Transcript and Stop-Transcript commands please visit http://technet.microsoft.com/en-us/library/hh849687.aspx and http://technet.microsoft.com/en-us/library/hh849688.aspx.

Share.

About Author

Christine Weaver has been the technical lead on projects designing, developing, deploying, supporting, and delivering solutions for SharePoint since 2003. Christine’s knowledge and experience leans heavily on her 10+ years as a software consultant and from being a Microsoft certified professional. Christine has been a regular presenter at TechDays Canada and runs the Halifax SharePoint User Group.

Leave A Reply