«

»

Install Microsoft PowerShell Core 6.0.1 and VMware PowerCLI 10.0.0 On macOS

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.

  1. 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.
    1. 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
    2. sudo mkdir -p /usr/local/microsoft/powershell/6.0.1
    3. sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/6.0.1
    4. sudo chmod +x /usr/local/microsoft/powershell/6.0.1/pwsh
    5. sudo ln -s /usr/local/microsoft/powershell/6.0.1/pwsh /usr/local/bin/pwsh
  2. Verify the PowerShell installation by running the command pwsh from a command line

    1. Verify that no VMware modules exists by running “Get-Module VMware* – ListAvailable”
  3. Install VMware PowerCLI by running the following command:
    1. Install-Module -Name VMware.PowerCLI -Scope CurrentUser
  4. Answer Y to the question if you want to install from an untrusted repository.
  5. Sit back and wait for the installation to complete.
  6. Now list available modules again.
  7. Import the modules needed for your automation purposes, e.g.ย VMware.VimAutomation.Core via the following command:
    1. Import-Module VMware.VimAutomation.Core
  8. 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:
    1. Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
  9. Verify functionality and in this case I just connected to a ESXi host, list the VMs and disconnected:
    1. Connect-VIServer 192.168.10.110
    2. Get-VM *
    3. Disconnect-VIServer -confirm:$false

Read more about the VMware PowerCLI 10.0.0 version here

1 ping

Comments have been disabled.