PowerCLI 11.1.0

PowerCLI 11.1.0 – More on Linux Side

During the last few days of December 2018, VMware released the 6th PowerCLI version of the year: PowerCLI 11.1.0. The coolest new features move around Site Recovery Manager:

  • Support for SRM module in MacOS and Linux
  • Support for Site Recovery Manager 8.1 API features
  • VMware.VimAutomation.Storage module received updates on 2 cmdlets: Get-VsanDisk and Start-SpbmReplicationTestFailover

There is nothing new on the install / update routines for Windows, so if you need guidance you can take a look at one of my previous article: VMware PowerCLI 10.1.0.

Install PowerCLI 11.1.0 on Linux

I previously wrote about how to install PowerCLI on Linux in the article PowerCLI 10.0.0 Linux Error in VMware.VimAutomation.Srm Module. There are few changes to the PowerShell Core installation procedure and also few more PowerCLI modules are supported on Linux (as a result there are few changes also to the workaround to make it work).

I will show below how to install PowerShell Core 6.1.1 and PowerCLI 11.1.0 on Ubuntu 16.04. At the moment of writing this article, Ubuntu 16.04 LTS is the only supported Linux version for PowerCLI (see Compatibility Matrixes for VMware PowerCLI 11.1.0).

First step for PowerShell installation is to download the Microsoft repository GPG keys :

wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb

PowerCLI 11.1.0 - Download Microsoft Repository GPG Keys

Then I had to register the downloaded Microsoft repository GPG keys

sudo dpkg -i packages-microsoft-prod.deb

PowerCLI 11.1.0 - Register Microsoft Repository GPG Keys.jpg

For next step, I updated the list of available products:

sudo apt-get update

PowerCLI 11.1.0 - UpdateProduct List.jpg

For last step, I started the installation:

sudo apt-get install -y powershell

PowerCLI 11.1.0 - Install PowerShell Core

Install PowerCLI 11.1.0 on Ubuntu 16.04 LTS

We can proceed now to install PowerCLI 11.1.0. I typed “pwsh” to enter PowerShell. Here we can see the PowerShell version 6.1.1. I then ran the normal command to install PowerCLI:

pwsh
Install-Module -Name VMware.PowerCLI -Scope CurrentUser

PowerCLI 11.1.0 - Install Module PowerCLI 11.1.0.

Once the installer finished, I tried to load PowerCLI module:

Import-Module VMware.PowerCLI

And the error is still here 🙁

Import-Module : VMware.VimAutomation.License module is not currently supported on the Core edition of PowerShell.

PowerCLI 11.1.0 - Import Module Error

Import-Module : VMware.VimAutomation.License module is not currently supported on the Core edition of PowerShell

Some of the PowerCLI modules are still not compatible with PowerShell Core. For PowerCLI to work, I had to disable some modules from loading when PowerCLI starts. The file where PowerCLI keeps its dependencies is VMware.PowerCLI.psd1. In my case, the full path to the file was:

/home/titi/.local/share/powershell/Modules/VMware.PowerCLI/11.1.0.11289667

Here you will find this section with required modules:

#Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
@{“ModuleName”=”VMware.VimAutomation.Sdk”;”ModuleVersion”=”11.0.0.10334495″}
@{“ModuleName”=”VMware.VimAutomation.Common”;”ModuleVersion”=”11.0.0.10334497″}
@{“ModuleName”=”VMware.Vim”;”ModuleVersion”=”6.7.0.10334489″}
@{“ModuleName”=”VMware.VimAutomation.Core”;”ModuleVersion”=”11.0.0.10336080″}
@{“ModuleName”=”VMware.VimAutomation.Srm”;”ModuleVersion”=”11.1.0.11289292″}
@{“ModuleName”=”VMware.VimAutomation.License”;”ModuleVersion”=”10.0.0.7893904″}
@{“ModuleName”=”VMware.VimAutomation.Vds”;”ModuleVersion”=”11.0.0.10336077″}
@{“ModuleName”=”VMware.VimAutomation.Vmc”;”ModuleVersion”=”11.0.0.10336076″}
@{“ModuleName”=”VMware.VimAutomation.Nsxt”;”ModuleVersion”=”11.0.0.10364044″}
@{“ModuleName”=”VMware.VimAutomation.vROps”;”ModuleVersion”=”10.0.0.7893921″}
@{“ModuleName”=”VMware.VimAutomation.Cis.Core”;”ModuleVersion”=”11.0.0.10335701″}
@{“ModuleName”=”VMware.VimAutomation.HorizonView”;”ModuleVersion”=”7.6.0.10230451″}
@{“ModuleName”=”VMware.VimAutomation.Cloud”;”ModuleVersion”=”11.0.0.10379994″}
@{“ModuleName”=”VMware.DeployAutomation”;”ModuleVersion”=”6.7.0.11233116″}
@{“ModuleName”=”VMware.ImageBuilder”;”ModuleVersion”=”6.7.0.11233116″}
@{“ModuleName”=”VMware.VimAutomation.Storage”;”ModuleVersion”=”11.1.0.11273342″}
@{“ModuleName”=”VMware.VimAutomation.StorageUtility”;”ModuleVersion”=”1.3.0.0″}
@{“ModuleName”=”VMware.VumAutomation”;”ModuleVersion”=”6.5.1.7862888″}
@{“ModuleName”=”VMware.VimAutomation.Security”;”ModuleVersion”=”11.0.0.10380515″}
)

We need to disable the incompatible modules: VMware.VimAutomation.License, VMware.VimAutomation.vROps, VMware.VimAutomation.HorizonView, VMware.VimAutomation.DeployAutomation, VMware.VimAutomation.ImageBuilder, and VMware.VimAutomation.VumAutomation. Compared with last time I checked PowerCLI for Linux (version 10.0.0), there are two more modules supported: VMware.VimAutomation.Srm and VMware.VimAutomation.Cloud. You need to comment each of the lines containing unsupported modules by placing a # at the beginning of the line:

#@{“ModuleName”=”VMware.VimAutomation.License”;”ModuleVersion”=”10.0.0.7893904″}
#@{“ModuleName”=”VMware.VimAutomation.vROps”;”ModuleVersion”=”10.0.0.7893921″}
#@{“ModuleName”=”VMware.VimAutomation.HorizonView”;”ModuleVersion”=”7.6.0.10230451″}
#@{“ModuleName”=”VMware.DeployAutomation”;”ModuleVersion”=”6.7.0.11233116″}
#@{“ModuleName”=”VMware.ImageBuilder”;”ModuleVersion”=”6.7.0.11233116″}
#@{“ModuleName”=”VMware.VumAutomation”;”ModuleVersion”=”6.5.1.7862888″}

Save the file and try again to import PowerCLI module:

PowerCLI 11.1.0

We can see now what modules are we running:

Get-Module -Name *VMware* | Select Name,Version

PowerCLI 11.1.0 - Modules

That’s all! Happy PowerCLI on Linux!

Constantin Ghioc

I usually play with vSphere API, Ansible, vRealize Automation, vRealize Orchestrator, and different AWS tools. In my other life I’m a husband and a father, an amateur photographer and a Go enthusiast.

3 thoughts to “PowerCLI 11.1.0 – More on Linux Side”

  1. Hi Constantin,
    Nice work, thanks for that, I was able to complete last step by disabling unsupported modules.
    Do you know a way to make New-VICredentialStoreItem and Get-VICredentialStoreItem on Linux?
    Thanks.

Leave a Reply