Categories: LinuxShellUbuntu

How to Launch PowerShell as a snap on Ubuntu

PowerShell is a command-line shell designed specifically for system administrators to simplify and automate server management. It is a very powerful and efficient tool that saves a lot of time by automating the wide range of local and remote management tasks. Microsoft launched PowerShell Core as a snap for Linux users. Now you can try out PowerShell on Linux.

In this article, we will see how to install PowerShell as a snap in Ubuntu. We will use Ubuntu 18.04 LTS to describe the procedure mentioned in this article.

Installing snapd on Ubuntu

For launching PowerShell as a snap in Ubuntu, we will first need to install Snap. Snap comes pre-installed in Ubuntu 18.04 LTS and 19.04 LTS. However, if you are using an older version or if you have accidentally removed it from your system, you can install it using the Ubuntu Terminal.

To enable snapd, run the following command in Terminal:

$ sudo apt install snapd

Installing Powershell on Ubuntu

Then to install PowerShell using snap, run the following command in Terminal:

$ snap install powershell --classic

Enter the password for the current user account, then click on Authenticate.

The installation will take less than a minute.

After installing PowerShell, launch it from the Ubuntu’s Dash menu. Alternatively, just type pwsh in the Terminal. It will bring up the PowerShell command line.

$ pwsh

Microsoft has also launched the preview version of PowerShell beta software. It is available as a separate snap.

To install PowerShell preview, run the following command in Terminal:

snap install powershell-preview –classic

Again enter the password for the user account, then click on Authenticate.

To launch PowerShell preview, just type the pwsh-preview in Terminal. It will bring up the PowerShell preview command line.

$ pwsh-preview

To view the version of PowerShell installed, run the following command in Terminal:

$ PSVersionTable

So, that was the brief overview of how to launch PowerShell as a Snap in Linux. Now you can use PowerShell as exactly as you would on Windows.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago