我如何 运行 Azure 应用服务 运行 上的 PowerShell 脚本 Linux?

How do I run a PowerShell script on an Azure App Service running Linux?

使用 SSH 远程进入应用服务 我收到了这条消息:

root@05831a60f815:/home# pwsh
-bash: pwsh: command not found

Microsoft 的新 PowerShell Core 似乎没有安装在 Azure 的 Linux 容器上。

我要在哪里定义要在我的 Linux 部署中安装 PowerShell?

我们在 Azure DevOps CI.

中将 ubuntu-latest 定义为我们的 vmImage

通常可以从 App Service Extension Development Tools 行下的 App Service Extension 完成。但在这种情况下,它没有任何 PowerShell 选项,所以我相信你需要手动安装它。

https://docs.microsoft.com/ru-ru/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7