This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      My builds started failing since updating to durable task plugin 1.18.  It would appear that the main script execution line was setting $LASTEXITCODE to 1 but $MAINSCRIPT was exiting with 0.

      powershellHelper.ps1 line 53 is currently:

      & { & $MainScript | Out-FileNoBom -Writer $OutputWriter } *>&1 | Out-FileNoBom -Writer $LogWriter;

      And my take is that Out-FileNoBom can contribute to the $LASTEXITCODE, so the step can fail because of a logging error.  I found removing the $LogWriter or even the "*>&1" made it start working in a sandbox outside of Jenkins. I think that running $MainScript in isolation and capturing that $LASTEXITCODE, then doing the logging may be a more robust solution?

      I've switched to using bat commands as a work around in the mean time.

            Assignee:
            Unassigned
            Reporter:
            Matt Cheale
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: