PowerCLI cannot be installed or updated because the authenticode signature of the file error

On a new Windows Server 2022 VM I tried to install a fresh copy of VMware.PowerCLI (13.0.0) with the following PowerShell command:

Install-Module VMware.PowerCLI -Scope CurrentUser

The following error occurred:

PackageManagement\Install-Package : The module ‘VMware.VimAutomation.License’ cannot be installed or updated because the authenticode signature of the file ‘VMware.VimAutomation.License.cat’ is not valid. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21 + … $null = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package], Exception + FullyQualifiedErrorId : InvalidAuthenticodeSignature,ValidateAndGet-AuthenticodeSignature,Microsoft.PowerShell.P ackageManagement.Cmdlets.InstallPackage

 

 

Using the -Force and -SkipPublisherCheck options fixed the error. The command to execute is:

Install-Module VMware.PowerCLI -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber

For existing installations, you can first remove PowerCLI and then install PowerCLI again:

Get-InstalledModule VMware.PowerCLI | Uninstall-Module -Force
Install-Module VMware.PowerCLI -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber

After the PowerCLI modules installation finishes you can run the following command to check what version is installed:

Get-InstalledModule VMware.PowerCLI | Select Name, Version

Certificate error

When trying to connect to the vCenter Server you’ve got the following error:

Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you’d like to connect once or to add a permanent exception for this server.

I had no trusted certificate installed. The following command ignores invalid certificates and suppresses the VMware Customer Experience Improvement Program:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -ParticipateInCeip $false

Now I was able to connect to vCenter Server with PowerCLI.

 

VIBSearch Finding VIB versions

VIBSearch is a simple PowerShell script with a GUI that will search for a specified VIB or all the VIBS installed on the ESXi hosts. A VIB stands for vSphere Installation Bundle (VIB). VIBs are used to package and distribute ESXi software such as drivers. The GUI is designed with SAPIEN PowerShell Studio 2014.

With VIBSearch it is easily to verify that all the ESXi host in the cluster have the same VIB versions installed. VIBSearch can be used for example to easily identify the HP-AMS driver version on all the ESXi hosts.

Requirements

VIBSearch is tested with:

  • PowerShell 5
  • The latests PowerCLI modules
  • For the Out-GridView cmdlet, PowerShell ISE is needed. Install ISE by using the following PowerShell commands:
    • Import-Module ServerManager
    • Add-WindowsFeature PowerShell-ISE

Installing and executing VIBSearch

  • Download VIBSearch.txt, link
  • Open PowerShell and execute:
    • Set-ExecutionPolicy  unrestricted
    • ./vibsearch.ps1

After executing the script the following GUI appears:

0

  • To connect enter the FQDN or IP address of the vCenter name (1) and click on Connect (2) button

1

  • A credential window appear, enter the credentials for authenticating (administrator) to the vCenter Server. For a domain login use: user user@domainname  or domainname\username

5

  • After successfully authenticating to the vCenter Server there are two options to choose:
    • List All the VIBS:  List all the ESXi hosts in the vCenter Server
    • Search VIB: specify a VIB name for example “HP-AMS”

6

If authentication to the vCenter Server fails the following error is displayed in the PowerShell window:

authen

Example output:

HP-AMS VIB versions

hpams

Intel NIC VIB “net-igb” versions

Intel

NVIDIA VIB versions:

nvidia

Thanks to Francois-Xavier Cat (@LazyWinAdm) for helping me with the VIBSearch tool.

 

Display VMware Horizon View Pool information using PowerCLI

For a VMware View Horizon Healthcheck I needed to display all VMware View Pools created and export some settings for documentation. The easiest way to do this is using View PowerCLI on a VMware View Connection server.

Here are some examples to use:

Display all the pools and settings:

get-pool

Display the pools with selected fields in table form:

Get-pool | select DisplayName,Pool_ID,Enabled,MinimumCount,MaximumCount,HeadroomCount,Persistence,Pooltype,Protocol | FT -AutoSize

image

Display the some fields in table form and export the pool information to a a text file:

get-pool | select DisplayName,Pool_ID,Enabled,MinimumCount,MaximumCount,HeadroomCount,Persistence,Pooltype,Protocol | FT -AutoSize | out-file c:\temp\pools.txt

The get-pool commands does not export all the settings that can be provided in a VMware View pool.