每次我的脚本没有正确结束并且没有执行 stop-transcript 时,我都会收到此消息:
Start-Transcript : Transcription has already been started. Use the stop-transcr
ipt command to stop transcription.
At C:\ps\003desifrovanie.ps1:4 char:17
+ start-transcript <<<< -path c:\_LOG\sfrbdesifrovanie.log -append
+ CategoryInfo : NotSpecified: (:) [Start-Transcript], InvalidOpe
rationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.Power
Shell.Commands.StartTranscriptCommand
是否可以检查脚本是否正在运行并在脚本开始时使用 if-then 停止它?或者如何在最后可靠地阻止它?谢谢