PS> Start-Transcript
PS> # do a bunch of stuff
PS> Stop-Transcript # or just quit the shell

This will create a file (by default in your My Documents folder) that is a verbatim copy of your shell session. No more copy and paste needed from the shell to notepad! A few other things of note:

  • This is the only way to capture verbose and warning information as those cannot be redirected from the shell like errors can (don't ask me why, but make sure to tell Jeffrey Snover about this)
  • You can start a transcript by default every time you start your shell by putting 'start-transcript' in your profile.ps1 file
  • There can change the location of the text file that is created. Look at get-help start-transcript for more details
Have fun!