in

How to install and use Microsoft’s PowerShell on Linux (and why you should)

How to install and use Microsoft’s PowerShell on Linux (and why you should)

Microsoft/Ubuntu/ZDNETPowerShell is a task automation and configuration management tool, designed and released by Microsoft, that consists of a command-line shell and a powerful scripting language. A lot of intermediate and advanced Windows users depend on this application for many different reasons and are probably concerned about what they’ll do when support for Windows 10 ends next year.

Also: The best Linux distribution of 2024 is MacOS-like but accessible to all

For those whose computers won’t support Windows 11, there’s good news: Linux!

And for those who depend on PowerShell, there’s even better news:

You can install PowerShell on Linux. Let me show you how.

How to install PowerShell on Ubuntu-based distributionsWhat you’ll need: To make this work, you’ll need a running instance of a Ubuntu-based distribution and a user with sudo privileges. That’s it. Let’s make some magic.

The first thing to do is log into your Linux desktop and open the terminal application.

Show more

There are a few dependencies that must first be installed, which can be done with a single command:

sudo apt-get install -y wget apt-transport-https software-properties-common -y

Show more

Next, we need to download the proper keys so the MS repository can be used. This is done with the following three commands:

source /etc/os-release
wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

The first command above copies the release version of your distribution into memory, the second downloads the correct key for your version, and the third command installs the key.

Show more

Also: Why I no longer recommend this Windows-like Linux distro

Update apt with the command:

sudo apt-get update

Finally, install PowerShell with:

sudo apt-get install powershell -y

Show more

How to install PowerShell on Fedora-based distributionsWhen using a Fedora-based distribution, the installation process looks like this.

1. Import the required security keysudo rpm –import https://packages.microsoft.com/keys/microsoft.ascFirst, you’ll need to import the necessary security key with the command:

2. Download and add the repositoryYou can then download and add the required MS repository with a single command:

curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo3. Install PowerShellPowerShell can now be installed with the following two commands:

sudo dnf makecache
sudo dnf install powershell -yHow to install PowerShell on Arch-based distributionsFinally, we’ll install Powershell on Arch-based Linux distributions. Surprisingly, this is the easiest installation because PowerShell can be installed from AUR (Arch User Repository) with two simple commands:

pacman -Syy
pacman -Ss powershell-binHow to start PowerShellNow that you have PowerShell installed, you can start it with the command:

You should now find yourself on the familiar PowerShell prompt, where you can start using this powerful tool as you did in Windows 10.

Also: The 3 most Windows-like Linux distros you can try because change is hard

Open Source Editorial standards

Report

What do you think?

Newbie

Written by Mr Viral

Leave a Reply

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

GIPHY App Key not set. Please check settings

Xmas Box-Office: “Sonic” Beats Lion, Bob Dylan

Xmas Box-Office: “Sonic” Beats Lion, Bob Dylan

I finally found a reliable wireless charger for all of my Google devices

I finally found a reliable wireless charger for all of my Google devices