title: powershell - how to check if transcript is running?
body: <p>I get this message everytime my script doesn't end properly and stop-transcript is not executed:</p>
  
  <pre><code>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 &lt;&lt;&lt;&lt;  -path c:\_LOG\sfrbdesifrovanie.log -append
  + CategoryInfo          : NotSpecified: (:) [Start-Transcript], InvalidOpe
  rationException
  + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.Power
  Shell.Commands.StartTranscriptCommand
  </code></pre>
  
  <p>Is it possible to check if transcript is running and stop it with if-then at start of the script? Or how to reliably stop it at the end? Thank you</p>