I utilise PowerShell transcription support heavily in my PS scripts. Essentially I utilise transcription as a replacement to having a logging framework - all logging is performed via Write-Host, Write-Verbose and Write-Debug calls, and then logged to file
via a call to Start-Transcript at the start of script execution.
Transcription support in PS versions prior to 5 is limited in that it is hard coded in the Start-Transcript and Stop-Transcript commands to throw an exception if the host is not an instance of Microsoft.PowerShell.ConsoleHost. Also, to make it even more difficult,
Stop-Transcript throws an error when there is no active transcript; but there is no way to detect if there is. Therefore, I use reflection to get the ConsoleHost.IsTranscribing internal property value to determine whether to call Stop-Transcript at script
completion. This logic has worked fine for PS versions 2, 3 and 4. However, more recently I believe a Windows Update patch has changed the way the transcription works. It appears that PS 4 now supports transcription functionality that I thought was PS 5 (CTP)
specific - nested transcription sessions (i.e. you can now continually call Start-Transcript and it will create more sessions, rather than throw an error when there is an active session). Also, the internals of how transcription is managed must have
changed because the IsTranscribing property no longer returns the correct value. I am unsure if there is now a "supported" way of checking for this rather than hacking into the internals of the host. This change results in my script creating multiple
transcription sessions as it does not know there is already transcription started.
Does anyone know if there has been any updates in PS 4 for the transcription functionality? Or any other details regarding this?
Cheers