In the following article we are going to take a look at how we can install PowerShell on Ubuntu 22.04. This is a configuration management and task automation platform. It consists of a shell of Command line cross-platform and an associated scripting language.
As we said, this is both a command line shell and scripting language with over 130 command line utilities called cmdlets. These follow extremely consistent naming and syntax conventions, and can be extended with custom cmdlets.
PowerShell(originally called Windows PowerShell) is a console interface (CLI), with the possibility of writing and joining commands by means of instructions. This console interface is designed for use by system administrators for the purpose of automating tasks or performing them in a more controlled manner. PowerShell is an object oriented shell.
Previously, Microsoft Windows PowerShell was only software available for Windows, but in 2016 the developers made it open source and cross-platform. That is why today being able to use it in Ubuntu is very simple. Even though after trying the different installation options available in Ubuntu 22.04, only the one we are going to see below has worked.
Table of Contents
Install Microsoft PowerShell on Ubuntu 22.04 LTS
PowerShell is now officially supported by most Gnu/Linux distributions. All the latest PowerShell packages for Gnu/Linux are available at GitHub.
Without a doubt the easiest way to install PowerShell in Ubuntu is using the package manager Snap, and that today, as I was saying, is the only way I have been able to install PowerShell on Ubuntu 22.04. This universal package manager is enabled by default in the system, so we will only have to open a terminal (Ctrl+Alt+T) and write in it:
sudo snap install powershell --classic
After the installation, we can start the program looking for your launcher in our system.
For, remove snap package that we just installed, in the terminal (Ctrl+Alt+T) you just have to use the command:
sudo snap remove powershell
With PowerShell users can use simple commands (to show the current time) and much more complex applications. It is also possible to use the combination of several commands ("pipeline"). For more information about this program, users can go to the project website.