Open In App

Microsoft Azure – Using PowerShell Core on Linux

Last Updated : 03 Apr, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

 PowerShell Core on Linux is now integrated into Azure Cloud Shell.  PowerShell used to be only available on Windows. Now, with PowerShell Core, it is cross-platform and runs on macOS and lots of Linux distributions like Ubuntu and Red Hat on ARM-Based platforms and even on Windows. This allows you to use PowerShell to interact with Azure regardless of the platform that you use, which is especially valuable if you are already using PowerShell with Azure on Windows. PowerShell Core is also an option for a scripting language for Azure Cloud Shell.

In this article,  you will learn how well it runs. 

Implementation:

Follow the below steps to use PowerShell Core on Linux:

Step 1: You are in the Azure Cloud Shell. You can use this from the Azure portal or in a full-screen experience by navigating to shell.azure.com. When you’ve logged into Azure Cloud Shell with PowerShell, you are using PowerShell Core that runs in a Linux Container. 

 

Step 2: You can also use Bash if you want, just type “Bash” or switch to it from the menu, and you can exit to PowerShell again. 

 

Step 3: Now, let’s see what’s running. This is the PowerShell version, PowerShell Core 6.0 and it runs on Linux, this provides you with some cool new features. You can for instance navigate through your Azure resources.

 

Step 4:  Start by CDing into your subscription. Now, you can say “Dare web apps”, to see all of your Web Apps in the context of your subscription. 

 

Step 5: You can also CD into a specific resource group. Now, you are in the context of the Resource Group. This means that you can do things like getting AGVM without specifying a resource group. You will have this VM in this resource group. This feature is from which can remotely PowerShell into this VM. 

 

To do that you first need to enable PowerShell remoting on the VM with the line. Once that is done, you can enter the VM with the enter AGVM. You need to fill in your credentials: username and your password. 

 

Step 6: Now, this is a PowerShell Command Prompt in the VM. So, let’s see what version of PowerShell is running on the VM. That is version five of the desktop version. Azure Cloud Shell is an essential tool for anybody that uses Azure and is now more powerful than ever. 

 

That’s how you can use Powershell Core on Linux.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads