Problem
You want to record a log or transcript of your shell session.
Solution
To record a transcript of your shell session, run the command StartTranscript Path. Path is optional and defaults to a filename based on the current system time. By default, PowerShell places this file in the My Documents directory. To stop recording the transcript of your shell system, run the command StopTranscript.
Discussion
Although the GetHistory cmdlet is helpful, it does not record the output produced during your PowerShell session. To accomplish that, use the StartTranscript cmdlet. In addition to the Path parameter described previously, the StartTranscript cmdlet also supports parameters that let you control how PowerShell interacts with the output file.