Install PowerShell&VMware PowerCLI on CentOS7

Good Morning!

I’ve already used CentOS as my main OS on the laptop for quite a while. And today I’ve needed to run some powershell commands straight away from my laptop without any jump servers. As Microsoft had started their way towards opensource it is possible to install on Linux machines now.

  1. As a first step, we need to register the repository which we can download from https://packages.microsoft.com/config/rhel/7/prod.repo
  2. Then just simply yum install powershell
  3. Type “pwsh” and you will get into powershell console.
  4. Install VMware.PowerCLI Module and you are done 🙂

As I used to work in windows for quite a  while and was using the full name of PowerShell to call it. I’ve simply made a symbolic link in /bin.

wget https://packages.microsoft.com/config/rhel/7/prod.repo
cat prod.repo >> /etc/yum.repos.d/microsoft.repo
yum install powershell
ln -s /opt/microsoft/powershell/6.1.0~preview.2/pwsh /bin/powershell
sudo powershell
InstallModule -Name VMware.PowerCLI

Hope this small tip would be useful for you!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.