PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Update-Module fails when new version is signed with new certificate

Open kamennikolov opened this issue 4 years ago • 2 comments

Prerequisites

Steps to reproduce

When updating from VMware PowerCLI 12.3 to 12.4 the Update-Module command fails with the error message below. The error message proposes the use of -SkipPublisherCheck, but Update-Module does not have such parameter. Even if it had I don't think that some of our highly regulated customers like banks, government organizations etc. would be fine with skipping the publisher check.

PackageManagement\Install-Package : Authenticode issuer 'CN="VMware, INC.", O="VMware, INC.", L=Palo Alto, S=California, C=US' of the new module 'VMware.VimAutomation.Sdk' with version '12.4.0' from root certificate authority 'CN=DigiCert High Assurance EV Root CA, 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' from root certificate authority 'CN=Verisign Class 3 Public Primary Certificate Authority - G5, OU=Verisign Trust Network, O=Verisign Inc, C=US'. If you still want to install or update, use -SkipPublisherCheck parameter. At C:\Users\user\Documents\PowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:13069 char:20

  • ... $sid = PackageManagement\Install-Package @PSBoundParameters
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidOperation: (Microsoft.PowerShel\u2026lets.InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : AuthenticodeIssuerMismatch,Validate-ModuleAuthenticodeSignature,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Expected behavior

The new version of the module is properly signed, so my expectation is that it should be installed without any errors. If users remove the old version first it installs without any issues.

Actual behavior

An error message is thrown

Error details

No response

Environment data

The same issue is observed in both PowerShell 5.1 and PowerShell 7

Visuals

Screenshot 2021-09-21 162040 Screenshot 2021-09-21 162019

kamennikolov avatar Sep 21 '21 13:09 kamennikolov

@alerickson @anamnavi @PaulHigin Please take a look to see if this is covered in the PowerShellGetv3

daxian-dbw avatar Sep 21 '21 17:09 daxian-dbw

Thanks for bringing this to our attention we will be sure to handle this scenario!

StevenBucher98 avatar Sep 23 '21 19:09 StevenBucher98