How to Install PowerShell on CentOS 8

Install PowerShell on CentOS 8

In this article, we will have explained the necessary steps to install and configure PowerShell on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Microsoft PowerShell is a .net-based configuration management and automation tool initially developed by Microsoft for the Windows operating system. These features are not available on the traditional Linux shell. It consists of a cross-platform (Windows, Linux, and macOS) command-line shell and associated scripting language.

Install PowerShell on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 3. Install PowerShell on CentOS.

The PowerShell RPM package is not available on your default CentOS repositories. We’ll add official Microsoft repositories using the command:

Next, install Microsoft PowerShell classic version you should execute the following command:

After the installation, start PowerShell using the command:

Then, try to run few commands to verify your installation:

Congratulation, you have learned how to install and configure PowerShell on CentOS 8. If you have any question, please leave a comment below.