18

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. Commented Sep 23, 2019 at 12:09
  • 1
    that was it, please post it as an answer and will upvote Commented Sep 23, 2019 at 13:05

1 Answer 1

25

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.

Sign up to request clarification or add additional context in comments.

7 Comments

The example with shell: pwsh is equivalent. The default shell for windows is pwsh, thus it is not necessary to specify it.
@MircoT and it's still required to be specified for non-Windows
Yes, but the workflow mentioned in the question was already windows-latest. This is why I don't understand the suggestion...
I think what happens is that when @Robert answered this question in 2019, pwsh was not the default back then
I tried with a self runner windows 2019 and got error as pwsh: command not found
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.