---

How to Install Powershell on CentOS Linux

Due to the release of Powershell Core, you can install powershell core and run PowerCLI commands on a Linux host. This will be a quick post to cover the steps required to get it installed.

Install Powershell on CentOS
The first step is to add the Microsoft repo to your Centos machine:

curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
Once done, Powershell can be downloaded and installed using Yum:

yum install -y powershell
When the install is complete you can run Powershell by running ???pwsh???:

[root@linux usr]# pwsh
PowerShell 6.2.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type ‘help’ to get help.

PS /usr
I have also written a separate post on this here, where you can see some examples of running powershell on linux.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis