In this article, we will have explained the necessary steps to install and configure Microsoft PowerShell on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo
privileges. All the commands in this tutorial should be run as a non-root user.
Microsoft PowerShell is a .net-based configuration management and automation tool initially developed by Microsoft for the Windows operating system. It consists of a cross-platform (Windows, Linux, and macOS) command-line shell and associated scripting language.
Microsoft PowerShell on Ubuntu
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
sudo apt update sudo apt upgrade
Step 2. Install Snap.
The PowerShell for Linux is also published in the Snap store for simple installation and continued updates:
sudo apt install snapd snapd-xdg-open
Step 3. Install Microsoft PowerShell on Ubuntu 18.04.
To install Microsoft PowerShell classic version you should execute the following command:
sudo snap install powershell –classic
After the installation, Snap will be automatically upgraded. You may also prompt a manual upgrade using the following command:
snap refresh powershell
To verify the Microsoft PowerShell installed correctly, you can execute the below PowerShell command inside it:
$PSVersionTable
Step 4. Accessing Microsoft PowerShell.
You can install Microsoft PowerShell by using two ways, either by visiting Activities -> type – Microsoft Powershell and clicking on the launcher icon when it appears or launch PowerShell by using the Terminal application by using the following command:
powershell
That’s all you need to do to install Microsoft PowerShell on Ubuntu 18.04 Bionic Beaver. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.