Installation Pester 4.9.0 gives Certificate error on clean win2019 installation without Skip Publisher Check
Used commando Find-Package Pester; Pester 4.9.0 PSGallery
Installation with: Install-Module Pester -Force
PackageManagement\Install-Package : A Microsoft-signed module named 'Pester' with version '3.4.0' that was previously installed conflicts with the new module 'Pester' from publisher 'CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US' with version '4.9.0'. Installing the new module may result in system instability. 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:Ins tallPackage) [Install-Package], Exception
- FullyQualifiedErrorId : PublishersMismatch,Validate-ModuleAuthenticodeSignature, Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Workaround: Install-Module Pester -Force -SkipPublisherCheck
This depends on the version of PowerShellGet module you are using. Could you send the version of that module please?
I'm having the same issue, so I'll try to answer your question. This occurs in PowerShell 5.1 using PowerShellGet ver 1.0.0.1. This does seem to be a problem with the version of PSGet itself, as installing Pester using PowerShell 7.0.0-preview5 and PowerShellGet 2.2.1 on the same system works just fine.
Following the instructions to update PowerShellGet in PowerShell 5.1 resolves this error.
Thx. Yes upgrading PowerShellGet is indeed the way to fix this.
The below command works for me,
Install-Module -Name Pester -Force -SkipPublisherCheck