I had a project to automate and upgrade VMware infrastructure. I had given few of the basic tasks to my fellow juniors to update VMware.PowerCLI modules on few servers and run script on the systems. But while upgrading VMware PowerCLI they were receiving below errors.
PackageManagement\Install-Package : Authenticode issuer 'CN=DigiCert Trusted Root G4, OU=www.digicert.com, O=DigiCert
Inc, C=US' of the new module 'VMware.VimAutomation.Sdk' with version '12.5.0.19093564' is not matching with the
authenticode issuer 'CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. -
For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US' of the previously-installed module
'VMware.VimAutomation.Sdk' with version '12.2.0.17531155'. If you still want to install or update, use
-SkipPublisherCheck parameter.
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 : AuthenticodeIssuerMismatch,Validate-ModuleAuthenticodeSignature,Microsoft.PowerShell.Pac
kageManagement.Cmdlets.InstallPackage
Install-Package: Authenticode issuer '[email protected], CN="VMware, Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the
new module 'VMware.VimAutomation.Sdk' with version '12.5.0.19093564' from root certificate authority 'CN=DigiCert
Trusted Root G4, OU=www.digicert.com, O=DigiCert Inc, C=US' is not matching with the authenticode issuer 'CN="VMware,
Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the previously-installed module 'VMware.VimAutomation.Sdk'
with version '12.2.0.17531155' from root certificate authority 'CN=VeriSign Class 3 Public Primary Certification
Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.",
C=US'. If you still want to install or update, use -SkipPublisherCheck parameter.
To troubleshoot the issue I checked the existing installed module version of VMware.PowerCLI on the system, and checked/compaired the available version online on the psgallery, I found I have outdated VMware.PowerCLI PowerShell module installed on the system.
When tried to update it with Update-Module command I was receiving error. I tried to Install module but receiving another error as below.
PS C:\Users\labev> Get-Module VMware.PowerCLI -ListAvailable Directory: C:\Program Files\WindowsPowerShell\Modules ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Manifest 12.3.0.17… VMware.PowerCLI Desk PS C:\Users\labev> Find-Module VMware.PowerCLI Version Name Repository Description ------- ---- ---------- ----------- 12.5.0.19195797 VMware.PowerCLI PSGallery This Windows PowerShell module contains … PS C:\Users\labev> Update-Module VMware.PowerCLI -Force Update-Module: Module 'VMware.PowerCLI' was not installed by using Install-Module, so it cannot be updated. PS C:\Users\labev> Install-Module VMware.PowerCLI -Force Install-Package: Authenticode issuer '[email protected], CN="VMware, Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the new module 'VMware.VimAutomation.Sdk' with version '12.5.0.19093564' from root certificate authority 'CN=DigiCert Trusted Root G4, OU=www.digicert.com, O=DigiCert Inc, C=US' is not matching with the authenticode issuer 'CN="VMware, Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the previously-installed module 'VMware.VimAutomation.Sdk' with version '12.2.0.17531155' from root certificate authority 'CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US'. If you still want to install or update, use -SkipPublisherCheck parameter.
This issue can be resolved deleting modules from the Powershell modules folder inside Program Files. Once the modules folder for Vmware are deleted try installing modules again, You can also mention the modules installation scope.
I needed the old version of PowerCLI so I used parameter -SkipPublisherCheck while installing module. and I got 2 versions of PowerCLI now one is under Program Files and another under users documents.
PS C:\Users\labev> Install-Module -Name VMware.PowerCLI -SkipPublisherCheck -Force PS C:\Users\labev> PS C:\Users\labev> Get-Module VMware.PowerCLI -ListAvailable Directory: C:\Users\labev\Documents\PowerShell\Modules ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Manifest 12.5.0.19… VMware.PowerCLI Desk Directory: C:\Program Files\WindowsPowerShell\Modules ModuleType Version PreRelease Name PSEdition ExportedCommands ---------- ------- ---------- ---- --------- ---------------- Manifest 12.3.0.17… VMware.PowerCLI Desk
If I check the current version of PowerCLI it shows it is using latest download and installed version. This gives preference to module installed under current user account.
PS C:\Users\labev> Get-PowerCLIVersion WARNING: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a better product. You can join using the following command: Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services on a regular basis in association with your organization’s VMware license key(s). This information does not personally identify any individual. For more details: type "help about_ceip" to see the related help article. To disable this warning and set your preference use the following command and restart PowerShell: Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false. WARNING: The cmdlet "Get-PowerCLIVersion" is deprecated. Please use the 'Get-Module' cmdlet instead. PowerCLI Version ---------------- VMware.PowerCLI 12.5.0 build 19195797 --------------- Component Versions --------------- VMware Common PowerCLI Component 12.5 build 19093563 VMware Cis Core PowerCLI Component PowerCLI Component 12.5 build 19093567 VMware VimAutomation VICore Commands PowerCLI Component PowerCLI Component 12.5 build 19093566 PS C:\Users\labev>
Useful Articles
Resetting root password in VMware vCenter Server Appliance
How to reset vCenter Server SSO [email protected] password
vCenter Server SSH received disconnect Too many authentication failures
vCenter Server Public Key Authentication configuration SSH error received disconnect Too many authentication failures
VMware vCenter server vcsa Setting IP IPv6 configuration failed, IP configuration not allowed
VMware vCenter Server Management Exception in invoking authentication handler user password expired
vCenter ui sorry this website doesn't exist 404 not found
Unable to save IP settings Install Stage 2 Set up vCenter Server configuration
VMware vCenter server Error no healthy upstream
VMware PowerCLI Connect-VIserver Could not connect using the requested protocol
VMware PowerCLI The remote server returned an error: (407) Proxy Authentication Required
VMware PowerCLI Connect-VIServer Object reference not set to an instance of an object
VMware PowerCLI esxcli namespace command elements empty no output