How to troubleshoot “The pipeline has been stopped”

Welcome Forums General PowerShell Q&A How to troubleshoot “The pipeline has been stopped”

Viewing 2 reply threads
  • Author
    Posts
    • #197990
      Participant
      Topics: 6
      Replies: 108
      Points: 510
      Helping Hand
      Rank: Major Contributor

      I have a large PS script and I am looking for advice in troubleshooting thie error: “PS>TerminatingError(): “The pipeline has been stopped.” This error occurs in the log file generated via Start-Transcript. I have no idea how to figure out where the pipeline breaks as the script is huge. The last item successfully logged to the log file is only about 10% into the script, yet the script completes tasks past this point.

      Some other key points. The end result of the script is an HTML file which does not get written to file until near the end of the script, and this completes, so in essence, the script completes most of what is expected. The remainder of the script does not complete, but if I can get the log entries to appear, I can troubleshoot this.

      Also, the script runs fine from the command line. This error only started when I moved it to a Scheduled Task. I have the Task running via the SYSTEM account if that helps.

      I know someone will suggest “post the code”, which is impossible due to the script size.

      Any suggestions on methods to troubleshoot this error are welcome and appreciated.

      • This topic was modified 6 months, 3 weeks ago by TonyD05.
    • #198002
      Senior Moderator
      Topics: 9
      Replies: 1257
      Points: 4,543
      Helping Hand
      Rank: Community Hero

      looks like a permission issue when ran as system account. Try running as some other account from taskscheduler to confirm.

    • #198077
      Participant
      Topics: 6
      Replies: 108
      Points: 510
      Helping Hand
      Rank: Major Contributor

      Well this turned out to be my own stupidity. I was looking at the wrong log file, the SYSTEM account uses C:\Windows\Temp for $ENV:Temp …

      Sometime you gotta wonder. Sorry for the bother.

Viewing 2 reply threads
  • The topic ‘How to troubleshoot “The pipeline has been stopped”’ is closed to new replies.