8

I'm calling .\build.ps1 and it seems to hang:

https://github.com/nblockchain/ZXing.Net.Xamarin/runs/232358091

Do I need something special? In AzureDevOps this was working out of the box.

2
  • 1
    Not sure if you have to specify shell to be run but I'm currently experiencing similar issue with my action (bash script). Already opened a ticket, but it's yet to be processed. Sep 23, 2019 at 12:09
  • 1
    that was it, please post it as an answer and will upvote
    – knocte
    Sep 23, 2019 at 13:05

1 Answer 1

16

As agreed in the comments, the solution for this issue was to specify the shell to be run in your Action file. In your case you had to change from:

    - name: Build
      run: |
        .\build.ps1

to:

    - name: Build
      shell: pwsh
      run: |
        .\build.ps1

For more details about available values for shell param, refer to documentation.

7
  • The example with shell: pwsh is equivalent. The default shell for windows is pwsh, thus it is not necessary to specify it.
    – MircoT
    Mar 14, 2021 at 23:23
  • @MircoT and it's still required to be specified for non-Windows Mar 15, 2021 at 7:05
  • Yes, but the workflow mentioned in the question was already windows-latest. This is why I don't understand the suggestion...
    – MircoT
    Mar 15, 2021 at 7:17
  • 3
    I think what happens is that when @Robert answered this question in 2019, pwsh was not the default back then
    – knocte
    Mar 18, 2021 at 6:31
  • 1
    I tried with a self runner windows 2019 and got error as pwsh: command not found Jun 2, 2022 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.