简体   繁体   English

如何使用 GithubActions 工作流调用 PowerShell 脚本?

[英]how to call PowerShell script with a GithubActions workflow?

I'm calling .\build.ps1 and it seems to hang:我打电话给.\build.ps1 ,它似乎挂起:

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

Do I need something special?我需要一些特别的东西吗? In AzureDevOps this was working out of the box.在 AzureDevOps 中,这是开箱即用的。

As agreed in the comments, the solution for this issue was to specify the shell to be run in your Action file.正如评论中所同意的,此问题的解决方案是指定 shell 在您的操作文件中运行。 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 .有关shell参数的可用值的更多详细信息,请参阅文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 vbscript 中调用 powershell 脚本? - How to call a powershell script in vbscript? 如何在 GitHub 工作流/操作中的 PowerShell 下运行名称中带有变量的脚本 - How run a script with variable in the name under PowerShell in GitHub workflow / actions 通过脚本“调用” Powershell工作流程 - “Invoking” Powershell workflow from a script 在javascript中如何调用powershell脚本 - in javascript how to call powershell script 如何通过传递参数从Powershell脚本调用Powershell脚本 - How to call powershell script from powershell script by passing the argument 如何使用参数将Powershell脚本调用到另一个Powershell脚本? - How to call a powershell script to another powershell script with arguments? 如何使用PowerShell脚本获取每个SP项目的SharePoint工作流状态? - How to get the SharePoint workflow status for each SP item with a PowerShell script? 如何从SharePoint 2010工作流中调用可执行文件或Powershell脚本? - How to invoke executable or powershell script from SharePoint 2010 Workflow? 如何使用powershell脚本中的参数调用可执行文件 - How to call an executable with parameters from powershell script 如何从Powershell调用批处理脚本? - How to call batch script from Powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM