How to Install PowerShell on Fedora Linux


PowerShell is both a command-line shell and fully-developed scripting language that is developed on the .WEB structure. Just like Bash, it is developed to perform and automate system administration jobs.

Until just recently, PowerShell was strictly a maintain for the Windows environment. That altered in August 2016 when it was made open-source and cross-platform with the intro of PowerShell Core which is developed on the .WEB core.

PowerShell is now offered for Windows, macOS, Linux, and ARM platforms such as Raspian. In this guide, we will stroll you through the setup of Microsoft PowerShell on Fedora Linux.

For this guide, we will utilize Fedora 34. There are 2 basic manner ins which you can utilize to set up PowerShell on Fedora and we will cover them in turn.

Method 1: Installing PowerShell Using Microfost Repositories

This is a 4-step setup technique that includes the following actions:

Add Microsoft RedHat Repository in Fedora

The initial step is to include the Microsoft Signature Key by running the following command.

$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

Next, utilize the curl command to include the Microsoft RedHat repository.

$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
Add Microsoft RedHat Repository
Add Microsoft RedHat Repository

Then upgrade Fedora to sync with the recently included repository.

$ sudo dnf upgrade

Install Powershell on Fedora

Finally, set up PowerShell utilizing the dnf plan supervisor as follows:

$ sudo dnf set up  powershell -y
Install PowerShell on Fedora
Install PowerShell on Fedora

To validate that PowerShell is set up, perform the command:

$ rpm -qi powershell

This supplies comprehensive info such as the variation, release setup date, architecture, and so on of the recently set up Powershell plan.

Check PowerShell on Fedora
Check PowerShell on Fedora

To gain access to the Powershell timely, just run the following command:

$ pwsh

From here you can run Linux commands and carry out scripting jobs on your recently set up PowerShell circumstances.

Access PowerShell on Fedora
Access PowerShell on Fedora

To exit Powershell, perform:

> exit

Method 2: Installing PowerShell from an RPM File

This is a more direct method of setting up PowerShell and is not meaningfully various from the very first technique. PowerShell 7.2 has actually provided the universal bundles for significant Linux circulations such as Debian, Ubuntu, CentOS, OpenSUSE, and Fedora. You can have a look at these bundles from the PowerShell GitHub repository.

When carried out, the RPM file essentially includes the GPG essential and the Microsoft repository on your system and continues to set up PowerShell.

So, run the following command to set up PowerShell utilizing the RPM file from the Github repository.

$ sudo dnf set up https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/powershell-lts-7.2.1-1.rh.x86_64.rpm

Uninstall PowerShell from Fedora Linux

If PowerShell is not your cup of tea, you can install it by running the command:

$ sudo dnf get rid of powershell

The UNIX shell is still the favored environment by many Linux users. It’s tidy, more reliable, and well recorded. Therefore, It’s clear that many users would choose dealing with celebration than Powershell offered the versatility and ease of usage it supplies.

Nonetheless, PowerShell is still extremely popular and jam-packed with numerous cmdlets for performing administrative jobs. In this guide, we have actually shown how you can set up PowerShell on Fedora.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most relied on neighborhood website for any sort of Linux Articles, Guides and Books on the internet. Millions of individuals check out TecMint! to browse or search the countless released short articles offered easily to all.

If you like what you read, please think about purchasing us a coffee ( or 2 ) as a token of gratitude.

Support Us

We are happy for your never ever ending assistance.

Synesy.org