Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50456

Pipeline continues after powershell error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • durable-task-plugin
    • None
    • jenkins 2.89.4, durable-task-plugin 1.22

      Pipeline script continues after errors in powershell script.

      Pipeline (none of the mentioned files exist!):
      node("...") {
          ws("x:\src") {
              powershell 'Copy-Item "a.xml" -Destination "b.xml"'
          }
      }

      output:
      [Pipeline] {
      [Pipeline] ws
      Running in x:\src
      [Pipeline] {
      [Pipeline] powershell
      [src] Running PowerShell script
      powershell.exe : Copy-Item : Cannot find path 'X:\src\a.xml' because it does not exist.
      At X:\src@tmp\durable-472cdca6\powershellWrapper.ps1:5 char:3
      + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Fi ...
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (Copy-Item : Can...does not exist. :String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError

      At X:\src@tmp\durable-472cdca6\powershellScript.ps1:1 char:1

      + Copy-Item "a.xml" -Destination "b.xml"

      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      + CategoryInfo : ObjectNotFound: (X:\src\a.xml:String) [Copy-Item

      ], ItemNotFoundException

      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.CopyI

      temCommand

      [Pipeline] }
      [Pipeline] // ws
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

            gabloe Gabriel Loewen
            wouterslob Wouter Slob
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: