Streams other than StdOut getting returned when using returnStdOut on PowerShell Step

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

XMLWordPrintable

      When executing the following pipeline with a verbose flag on a function and returnStdout specified, I am seeing the Verbose stream getting returned with Stdout.

      node{
        def psOutput = powershell(returnStdout: true, script: """
                            function Get-TestFunction {
                              [CmdletBinding()]
                              Param
                              (
                              )
      
                              Begin{
                              }
                              Process{
                                Write-Output 'hello'
                                Write-Verbose 'world'
                              }
                              End{
                              }
                            }
      
                            Get-TestFunction  -verbose
                        """)
        echo psOutput
      }
      

      Console Output:.

      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] node
      Running on Jenkins in D:\Jenkins-Windows\workspace\jaredtest
      [Pipeline] {
      [Pipeline] powershell
      [jaredtest] Running PowerShell script
      [Pipeline] echo
      hello
      VERBOSE: world
      
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      I would expect to see the Verbose stream getting written within the PowerShell script output. This is causing issues as we use the -verbose flag to see the details of things as they execute, but depend on Stdout to take action later on.

      If I perform the same pipeline on Durable Task Pipeline 1.14, I get the following output:

      [Pipeline] node
      Running on master in D:\Jenkins-Windows\workspace\jaredtest
      [Pipeline] {
      [Pipeline] powershell
      [jaredtest] Running PowerShell script
      world
      Cannot contact : java.nio.file.NoSuchFileException: D:\Jenkins-Windows\workspace\jaredtest@tmp\durable-7c2251e3\output.txt
      [Pipeline] echo
      hello
      
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

            Assignee:
            Gabriel Loewen
            Reporter:
            Jared Kauppila
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: