Really good news for all Linux & MacBook users out there. A while back Microsoft released Microsoft PowerShell for Linux and MacOS and yesterday, 2018.02.28, VMware released VMware PowerCLI 10.0.0, formerly known as vSphere PowerCLI, and it also supports both platforms.
To be able to run VMware PowerCLI on your MacBook you first need to install Microsoft PowerShell Core 6.0, more specifically version 6.0.1, which supports both multiple Linux distros and macOS.
Since I’m a MacBook user since quite a few years this is really good news for me.
Just follow the below steps to get going with VMware PowerCLI on macOS.
- Download Microsoft PowerShell Core 6.0 and run the installation. The below commands are available from the Microsoft PowerShell Core 6.0 download page but do not just copy and paste them, make sure to change version from 6.0.0 to 6.0.1 to be able to use all the VMware PowerCLI modules.
- curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.1/powershell-6.0.1-osx-x64.tar.gz
- sudo mkdir -p /usr/local/microsoft/powershell/6.0.1
- sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/6.0.1
- sudo chmod +x /usr/local/microsoft/powershell/6.0.1/pwsh
- sudo ln -s /usr/local/microsoft/powershell/6.0.1/pwsh /usr/local/bin/pwsh
- curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.1/powershell-6.0.1-osx-x64.tar.gz
- Verify the PowerShell installation by running the command pwsh from a command line
- Install VMware PowerCLI by running the following command:
- Install-Module -Name VMware.PowerCLI -Scope CurrentUser
- Install-Module -Name VMware.PowerCLI -Scope CurrentUser
- Answer Y to the question if you want to install from an untrusted repository.
- Sit back and wait for the installation to complete.
- Now list available modules again.
- Import the modules needed for your automation purposes, e.g. VMware.VimAutomation.Core via the following command:
- Import-Module VMware.VimAutomation.Core
- One more thing, if you haven’t install trusted certificates for e.g. vCenter Server and ESXi hosts there will be a connection error with VMware PowerCLI 10.0.0 instead of a Warning which used to be the case. To bypass the error if you have self-signed certificates you need to run the following command:
- Verify functionality and in this case I just connected to a ESXi host, list the VMs and disconnected:
Read more about the VMware PowerCLI 10.0.0 version here
1 pings