mhmd.io || openDocs

How to Install PowerCLI on CentOS ?

November 26, 2020

In this article I will show you How to Install PowerCLI on CentOS, with Some Enterprises, most of the production or staging servers has no internet connectivity and you need to install PowerCLI behind a proxy.

What is VMware PowerCLI

VMware PowerCLI is a command-line and scripting tool built on Windows PowerShell, and provides more than 700 cmdlets for managing and automating vSphere, VMware Cloud Director, vRealize Operations Manager, vSAN, NSX-T, VMware Cloud Services, VMware Cloud on AWS, VMware HCX, VMware Site Recovery Manager, and VMware Horizon environments.

Tested on

OSVersion
CentOS7

Export proxy settings

export http_proxy=http://proxy.mhmd.io:3128
export https_proxy=http://proxy.mhmd.io:3128

Install PowerShell

# Register the Microsoft RedHat repository
curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo
# Install PowerShell
yum install -y powershell

Install VMware.PowerCLI

pwsh -command Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
pwsh -command Install-Module VMware.PowerCLI,PowerNSX,PowervRA

👋 Salam people, I’m Mohammed Yahya [Almusaddar][محمد يحيى المصدر], from Gaza, Palestine. I’m working on Developing Cloud Solutions and Automation Projects using Pulumi, Terraform, Vault, Ansible and other Open Source tools.

...