Install Powershell Core and Running PowerCLI on CentOS

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.

Install and Run PowerCLI on CentOS

Now we can import of the PowerCLI modules by running:

PS /usr> install-module vmware.powercli

Once the module has been imported you should be able to run PowerCLI commands! Being able to install powershell core and run PowerCLI on a linux system is a very useful option to have available!

Related posts

Docker Exec Command With Practical Examples

Debugging with Git Bisect

A Beginners Guide to Azure Repos

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