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

问题描述

使用SSH远程进入App Service,并收到以下消息:

enter image description here

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

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

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

我们在Azure DevOps CI中将ubuntu-latest定义为vmImage

解决方法

通常可以在{strong>开发工具行下的App Service Extension中完成此操作。但是在这种情况下,PowerShell没有任何选择,因此我相信您需要手动安装。

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