VMware PowerCLI 12.1.0

VMware PowerCLI 12.1.0

Six months after the previous version of PowerCLI, VMware released the new VMware PowerCLI 12.1.0. I will cover in this article the improvements brought by PowerCLI 12.1.0 and the easy installation process on both Windows and Linux. For full documentation on this version of PowerCLI you can check the code.vmware.com page.

PowerCLI 12.1.0 Changes

New features and updates:

  • New cmdlets have been added to the VMware.VimAutomation.WorkloadManagement module: Get-WMCluster, Set-WMCluster, Enable-WMCluster, Disable-WMCluster.
  • New cmdlets have been added to the VMware.VimAutomation.Core module for managing vSphere Lifecycle Manager: Get-LcmImage, Test-LcmClusterCompliance, Test-LcmClusterHealth.
  • Existing cmdlets from VMware.VimAutomation.Core module have been improved: New-Cluster, Set-Cluster, New-ContentLibraryItem, Set-ContentLibraryItem, New-VM, Set-VM, New-Datastore, New-HardDisk, Get-NetworkAdapter, Get-VirtualNetwork, Set-ScsiLun.
  • New cmdlets have been added to the VMware.VimAutomation.Vmc module for specifying cluster’s EDRS policies: Get-VmcClusterEdrsPolicy, Set-VmcClusterEdrsPolicy.
  • Existing cmdlets from VMware.VimAutomation.Vmc module have been improved: New-VmcSddc, Add-VmcSddcHost, Remove-VmcSddcHost.
  • New cmdlets have been added to the VMware.VimAutomation.Storage module for managing vSAN secure disk wipe: Start-VsanWipeVsanDisk, Get-VsanWipeDiskState, Stop-VsanWipeVsanDisk.
  • New cmdlets have been added to the VMware.VimAutomation.Storage module for managing Cloud Native Storage volumes: Get/New/Set/Remove-CnsVolume, New-CnsContainerCluster, New-CnsKubernetesEntityReference, New-CnsKubernetesEntityMetadata, New-CnsVolumeMetadata, Add-CnsAttachment, Remove-CnsAttachment.
  • New cmdlet has been added to the VMware.VimAutomation.Storage module for managing Virtual Volume (vVol) storage containers: Get-VvolStorageContainer.
  • Existing cmdlets from VMware.VimAutomation.Storage module have been improved: Set-VsanClusterConfiguration, Get-VsanClusterConfiguration, Get-VsanSpaceUsage, Get-VasaStorageArray, Get-VasaProvider.
  • Existing cmdlets from VMware.VimAutomation.Security module have been improved: Get-TrustedClusterAppliedStatus, Set-TrustedCluster, New-TrustAuthorityKeyProvider, Set-TrustAuthorityKeyProvider, Set-TrustAuthorityTpm2AttestationSettings, Add-TrustedClusterAttestationServiceInfo, Add-TrustedClusterKeyProviderServiceInfo, Remove-TrustedClusterKeyProviderServiceInfo, Remove-TrustedClusterAttestationServiceInfo.
  • Added to the supported list in the compatibility matrix: vCenter Server 7.0 U1, vSAN 7.0 U1, vSphere 7.0 U1, Site Recovery Manager 8.3 and 8.3.1, Horizon 7.13
  • Removed from the supported list in the compatibility matrix: vCloud Director for Service Providers 9.5, Site Recovery Manager 6.1.1, vRealize Operations Manager 6.6.1 and 6.7

Bug Fixes

  • When using Get-HCXMigration, the migration progress percentage shows 0.
  • When running Get-HCXNetwork, PowerCLI does not recognize the OpaqueNetwork network types.
  • Get-OvfConfiguration does not display the full network name when it contains “.”.
  • When running Get-SpbmCapability, PowerCLI does not interpret correctly capabilities of type System.Array.
  • When using Get-VMHostHardware for some ESXi hosts, the PowerShell process fails.
  • When running Move-VM against vSphere 6.7 or later, you cannot move a virtual machine to the folder destination.
  • When running Cross vCenter vMotion with PowerCLI, an error message of type Object reference not set to an instance of an object appears.
  • When trying to move a powered off virtual machine to a folder, the operation fails with a message of type Unable to access the virtual machine configuration: Unable to access file.
  • You cannot trigger an HCX OS Assisted Migration, if the destination site is VMware Cloud Director.
  • When using New-NetworkAdapter on some guest operating systems, the cmdlet does not respect the Type parameter and always creates Vmxnet network adapters.
  • When running Remediate-Inventory, the operation fails with a message of type ”registry.proxy.’ is invalid or exceeds the maximum number of characters permitted’.
  • When using Set-DrsClusterGroup, you cannot add virtual machines to an empty DRS group.
  • When trying to update multiple DRS rules from different servers and specify virtual machines with identical IDs on different servers, you receive an error message and the process fails.
  • When running Update-Entity, the operation fails with a message of type ”registry.proxy.’ is invalid or exceeds the maximum number of characters permitted’.
  • When trying to upgrade a VMFS5 datastore to VMFS6 by using the Update-VmfsDatastore cmdlet, an error message of type item has already been added. key in dictionary appears.

Install PowerCLI 12.1.0

Moving to the easy part now, let’s install PowerCLI 12.1.0 in a new Windows box. Make sure you have at least PowerShell 5.1 installed, open a PowerShell console and run the install command:

Install-Module VMware.PowerCLI -Scope CurrentUser

Install PowerCLI 12.1.0 on Windows

The install procedure for Linux is the same, we need to run same command at a PowerShell prompt. Make sure you have installed at least PowerShell 7.

Install PowerCLI 12.1.0 on Ubuntu

Happy PowerCLI scripting 🙂

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.

Leave a Reply