简体   繁体   English

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

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

Using SSH to remote into the App Service I'm greeted with this message:使用 SSH 远程访问应用服务,我收到以下消息:

在此处输入图片说明

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

It would appear that Microsoft's new PowerShell Core is not installed on Azure's Linux containers.微软的新 PowerShell Core 似乎没有安装在 Azure 的 Linux 容器上。

Where do I define that I want PowerShell to be installed on my Linux deployment?我在哪里定义我希望在我的 Linux 部署中安装 PowerShell?

We have defined ubuntu-latest as our vmImage in our Azure DevOps CI.我们在 Azure DevOps CI 中将ubuntu-latest定义为vmImage

It usually can be done from App Service Extension under Development Tools line.它通常可以通过开发工具行下的App Service Extension来完成。 But in this case it doesn't have any option for PowerShell, so I believe you would need to install it manually.但在这种情况下,它没有任何 PowerShell 选项,因此我相信您需要手动安装它。

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

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

相关问题 如何在 Azure App Service Linux 上运行脚本 - How Run script on Azure App Service Linux 如何使用服务帐户凭据在 Linux 上运行 Azure 代理? - How do I run the Azure Agent on Linux with Service Account credentials? 如何使用 PowerShell(az 模块)部署到 Azure 应用服务? - How do I deploy to Azure App Service with PowerShell (az module)? 如何使用 PowerShell 部署到 Azure 应用服务? - How do I deploy to Azure App Service with PowerShell? 如何处理Azure App Service中长期运行的作业? - How do I handle long running jobs in Azure App Service? Azure Devops - 如何在部署后的应用服务上运行 powershell 脚本? - Azure Devops - How to run a powershell script on an App Service post-deploy? 如果 Azure 应用服务实例失败,如何触发 PowerShell 脚本 - How to trigger PowerShell script if Azure App service instance fails 如何使用Powershell创建在Linux上运行的Azure Web应用程序? - How do I use Powershell to create an Azure Web App that runs on Linux? 如何在Azure App Service Linux上从Node.Js应用运行获取日志输出? - How do i get log output from Node.Js app runnng on Azure App Service Linux? 在 Azure 应用服务 Linux 中运行 Puppeteer - Running Puppeteer in Azure App Service Linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM