Microsoft PowerShell is a shell framework used to execute commands, but primarily it is developed to perform administrative tasks such as
PowerShell is an open-source and cross-platform project; it can be installed on Windows, macOS, and Linux. It includes an interactive command-line shell and a scripting environment.
Ubuntu 18.04 has made installation of apps much easier via snap packages. For those who’re new to the phrase “snap package”, Microsoft has recently introduced a snap package for PowerShell. This major advancement allows Linux users/admins to install and run the latest version of PowerShell in fewer steps explained in this article.
The following minimum requirements must exist before installing PowerShell 6.1.1 in Ubuntu 18.04
There are two ways to install PowerShell in Ubuntu i.e. via terminal or via Ubuntu Software Application.
Step 1: Open A Terminal Console
The easiest way to open a Terminal is to use the key combination Ctrl+Alt+T at the same time.
Step 2: Snap Command to Install PowerShell
Enter snap package command i.e. “snap install powershell --classic” in the Terminal console to initiate installation of PowerShell in Ubuntu.
The prompt of Authentication Required on your screen is exclusively for security purposes. Before initiating any installation in Ubuntu 18.04, by default, the system requires to authenticate the account initiating this installation.
To proceed, the user must enter credentials of the account they’re currently logged in with.
Step 3: Successful Installation of PowerShell
As soon as the system authenticates the user, Installation of PowerShell will begin in Ubuntu. (Usually, this installation takes 1-2 minutes)
The user can continuously see the status of installation in the terminal console.
At the end of the installation, the status of PowerShell 6.1.1 from ‘microsoft-powershell’ installed is shown as it can be seen in the screenshot below.
Step 4: Launch PowerShell via Terminal
After successful installation, it’s time to launch PowerShell which is a one-step process.
Enter Linux command “powershell” in the terminal console and it will take you to PowerShell terminal in an instant.
powershell
You must be in the PowerShell prompt by now and ready to experience the world of automation and scripting.
Step 1: Open Ubuntu Software
Ubuntu has facilitated its users with a desktop application of Ubuntu Software. It contains the list of all software and updates available.
Step 2: Search for PowerShell in Ubuntu Software
Step 3: Installing PowerShell via Ubuntu Software
(for reference, it’s marked in below image)
(Installation via Ubuntu Software takes 1-2 minutes)
Step 4: Launch PowerShell via Ubuntu Software
After successful installation of PowerShell 6.1.1 via Ubuntu Software, the user can now launch PowerShell terminal and use it for multiple purposes and features which Microsoft PowerShell has to offer for its Linux users.
To test if PowerShell is working accurately, the user can enter few Linux commands like:
“$PSVersionTable” to find Version of PowerShell installed (for reference, the result of this command attached in the screenshot below)
PowerShell gives its user endless power over the system and its directories. After following the above-mentioned steps in this article, now you must be all set to experience the exciting and productive world of automation and scripting through Microsoft PowerShell.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…