How to Install PowerShell on ubuntu 20.04 LTS


 

PowerShell is used to automate the task configuration management system from Microsoft, comprising of an order line shell and the related prearranging language, it was made open-source and cross-stage on 18 August 2016 with the presentation of PowerShell Core.[5] The previous is based on the .NET Framework, the last on .NET Core.

In this post, We will install PowerShell on ubuntu 20.04 LTS


Step 1: Download the Repository

 

You need to add powershell repository for this, You need to donwoad .deb packages by using the following command.

$ wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb

 

Step 2: Add the PowerShell Repository 

 

You need to execute the following command to add the required repository.

$ sudo dpkg -i packages-microsoft-prod.deb


 

Step 3: Install PowerShell

 

We are ready to install Powershell package on ubuntu but before that we need to update the current ubuntu repository by using the given command.

$ sudo apt-get update
$ sudo apt-get install powershell -y


 

Step 4: Get Powershell 

 

You need to execute the pwsh command on your terminal to get access on powershell, Execute the command like this.

$ pwsh


 

Step 5: Verify the Powershell Version

 

To get powershell version, You need to execute the following command.

$PSVersionTable.PSVersion 


if everything is okay, So then you will get the sample output like this.


 

Step 6: To Uninstall Powershell

 

If you required to uninstall the installed Powershell packages from your ubuntu machine, So then you can use the given command.

$ sudo apt-get remove powershell -y 

Conclusion

 

In this post, We have Installed Powershell on ubuntu 20.04 LTS server, Still you have any question, Please leave a comment.

How to Install PowerShell on ubuntu 20.04 LTS

3 thoughts on “How to Install PowerShell on ubuntu 20.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top