The ability to create transcripts of your PowerShell activity is great for keeping track of what you’ve done. They are also very useful when testing as you can keep a record of your results.
There’s one problem though – transcripts don’t work in the ISE. Try this in PowerShell 4.0 or earlier:
Start-Transcript -Path C:\Temp\tran1.txt
You’ll get an error like this:
Start-Transcript : This host does not support transcription.
At line:1 char:1
+ Start-Transcript -Path C:\Temp\tran1.txt
+ CategoryInfo : NotImplemented: (:) [Start-Transcript], PSNotSup
+ FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.Start
Your script will run then you’ll get another error:
Stop-Transcript : This host does not support transcription.
At line:3 char:1
+ CategoryInfo : NotImplemented: (:) [Stop-Transcript], PSNotSupp
+ FullyQualifiedErrorId : NotSupported,Microsoft.PowerShell.Commands.StopT
Now try the same in PowerShell 5.0 and you’ll get this:
Transcript started, output file is C:\Temp\tran1.txt
Your script will run and you’ll see this at the end:
Transcript stopped, output file is C:\Temp\tran1.txt
Your transcript file will will be created and contain the desired output.
Another useful addition to your PowerShell tool kit – transcripts now work in ISE