How to Install PowerShell on Fedora

0

PowerShell is an command line interface as well as a scripting language developed by Microsoft. Similar to bash programing, the PowerShell is also used for automating the jobs for the system management. The current version of PowerShell supported Fedora 32 or greater versions.

PowerShell is also available for the Linux systems with an official package repository. This tutorial will help you for installing PowerShell on Fedora Linux system.

Prerequisites

You must be login as root account or sudo privileged account to your Fedora Linux system.

Enable Microsoft Repository in Fedora

First of all add the Microsoft signature key to your Fedora system by running the following command.

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

Next, execute the following command to add the Microsoft repository to the Fedora system

sudo rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm 

Install PowerShell in Fedora

Now run the ‘dnf check-update’, which update the metadata of all enabled repositories. This will not actually update the packages but list all packages.

sudo dnf check-update 

Now, You are prepared to install PowerShell on Fedora system. Run the below command to install PowerShell on Fedora Linux system.

sudo dnf install powershell 
Installing PowerShell on Fedora Linux

That’s it. This will complete the PowerShell installation on your Fedora system.

Access PowerShell in Fedora

To access the PowerShell terminal, type pwsh on a terminal. On successful, you will get the Powershell terminal as below.

pwsh 
How to Install PowerShell on Fedora Linux
Connect to PowerShell

After getting the prompt, type “help” to get detailed information about uses.

How to Uninstall PowerShell on Fedora

If you don’t need PowerShell anymore on your system. Simply type below command to uninstall it.

sudo dnf remove powershell

Conclusion

This guide helped you for installing PowerShell on Fedora Linux system. Now you can use PowerShell features to administer your server and automate the tasks.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More