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.
- As a first step, we need to register the repository which we can download from https://packages.microsoft.com/config/rhel/7/prod.repo
- Then just simply yum install powershell
- Type “pwsh” and you will get into powershell console.
- 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.
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
Hope this small tip would be useful for you!