Skip to content

Powershell error output not shown #26951

Discussion options

You must be logged in to vote

Thanks for forwarding this on!

I’ve done some further investigation, and some further investigation.

As far as I can tell, if script processing results in an exception being thrown, then:

  1. script processing will stop (as expected),
  2. no error message shown, and
  3. the result “Process completed with exit code 1” will be shown.

This is understandable, but the lack of error output creates confusion and becomes difficult to debug.

It is possible to work around this limitation by specifying a custom shell:

- name: Do the thing
      run: |
          .github/bin/do-thing.ps1 -Path 'foo' -WhatThing '${{ env.THING }}'
      shell: |
        pwsh -noninteractive -command "try {{ $ErrorActionPreference…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants