O'Reilly logo

Microsoft Exchange Server PowerShell Cookbook - Third Edition by Mike Pfeiffer, Jonas Andersson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging shell sessions to a transcript

You may find it useful at times to record the output of your shell sessions in a log file. This can help you save the history of all the commands you've executed and determine the success or failure of automated scripts. In this recipe, you'll learn how to create a PowerShell transcript.

How to do it...

To create a transcript, perform the following steps:

  1. Execute the Start-Transcript cmdlet:
    Start-Transcript c:\logfile.txt
    
  2. You can stop recording the session using the Stop-Transcript cmdlet:
    Stop-Transcript
    

How it works...

When starting a PowerShell transcript, you can specify a path and a filename that will be used to record your commands and their output. The use of the -Path parameter is optional; if you do ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required