Skip to content

Setting output path fails(?) using PowerShell running on windows-latest via mcr.microsoft.com/windows/servercore:ltsc2022 #567

Discussion options

You must be logged in to vote

I guess the problem here is you pwsh script is run using cmd (for the same reason sh is used for linux job containers). (that the log shows pwsh instead of cmd is a bug inherited by the actions/runner, where it only applies to linux)...

My app basically rewrites your workflow a bit to have the container field set, but you are right making powershell default makes sense if you use the -P windows-latest=image syntax.

Please try the following

      - name: Find .trx
        id: trx
        run: |
          $path = (ls -Recurse -Filter *.trx | select -First 1).FullName
          "path=$path" >> $env:GITHUB_OUTPUT
        shell: powershell # or pwsh

or put above your job, this makes your shell…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kohanyirobert
Comment options

@ChristopherHX
Comment options

@kohanyirobert
Comment options

Answer selected by kohanyirobert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants