Has there been updates to transcription support in a PS 4 Windows Update? Behaviour has changed...
i utilise powershell transcription support heavily in ps scripts. utilise transcription replacement having logging framework - logging performed via write-host, write-verbose , write-debug calls, , logged file via call start-transcript @ start of script execution.
transcription support in ps versions prior 5 limited in hard coded in start-transcript , stop-transcript commands throw exception if host not instance of microsoft.powershell.consolehost. also, make more difficult, stop-transcript throws error when there no active transcript; there no way detect if there is. therefore, use reflection consolehost.istranscribing internal property value determine whether call stop-transcript @ script completion. logic has worked fine ps versions 2, 3 , 4. however, more believe windows update patch has changed way transcription works. appears ps 4 supports transcription functionality thought ps 5 (ctp) specific - nested transcription sessions (i.e. can continually call start-transcript , create more sessions, rather throw error when there active session). also, internals of how transcription managed must have changed because istranscribing property no longer returns correct value. unsure if there "supported" way of checking rather hacking internals of host. change results in script creating multiple transcription sessions not know there transcription started.
does know if there has been updates in ps 4 transcription functionality? or other details regarding this?
cheers
hi bardo,
i tested on powershell 4.0 , powershell 5.0 , found can run "start-transcript" , "stop-transcript" multiple times without error in powershell 5.0 not in powershell 4.0:
if behavior has prevented the script running, please use try , catch in script:
try { start-transcript -path c:\anna\power1.log} catch [system.invalidoperationexception] { write-host "$_.exception.message"} if there else regarding issue, please feel free post back.
if have feedback on our support, please click here.
best regards,
anna wang
technet community support
please remember mark replies answers if , unmark them if provide no help. if have feedback technet support, contact tnmff@microsoft.com
Windows Server > Windows PowerShell
Comments
Post a Comment