Feb 17 2020 02:54 AM
Trying to install any package results in a hash mismatch. Here's my verbose output:
PS C:\Users\jh> install-module powershellget -verbose -scope AllUsers
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified. PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='powershellget'' for ''.
VERBOSE: Total package yield:'1' for the specified package 'powershellget'.
VERBOSE: Performing the operation "Install-Module" on target "Version '2.2.3' of module 'PowerShellGet'".
VERBOSE: The installation scope is specified to be 'AllUsers'.
VERBOSE: The specified module will be installed in 'C:\Program Files\PowerShell\Modules'.
VERBOSE: The specified Location is 'NuGet' and PackageManagementProvider is 'NuGet'.
VERBOSE: Downloading module 'PowerShellGet' with version '2.2.3' from the repository 'https://www.powershellgallery.com/api/v2'.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='PowerShellGet'' for ''.
VERBOSE: Package 'PackageManagement' is already installed.
VERBOSE: Package 'PackageManagement' is already installed.
VERBOSE: InstallPackage' - name='PowerShellGet', version='2.2.3',destination='C:\Users\jh\AppData\Local\Temp\1026672374'
VERBOSE: DownloadPackage' - name='PowerShellGet', version='2.2.3',destination='C:\Users\jh\AppData\Local\Temp\1026672374\PowerShellGet.2.2.3\PowerShellGet.2.2.3.nupkg', uri='https://www.powershellgallery.com/api/v2/package/PowerShellGet
/2.2.3'
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/PowerShellGet/2.2.3'.
VERBOSE: Completed downloading 'https://www.powershellgallery.com/api/v2/package/PowerShellGet/2.2.3'.
VERBOSE: Completed downloading 'PowerShellGet'.
VERBOSE: Hash for package 'PowerShellGet' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='PowerShellGet', version='2.2.3',destination='C:\Users\jh\AppData\Local\Temp\1026672374'
Install-Package: C:\program files\powershell\7-preview\Modules\PowerShellGet\PSModule.psm1
Line |
9683 | $installedPackages = PackageManagement\Install-Package @PSBoundParameters
| ^ Package 'PowerShellGet' failed to be installed because: End of Central Directory record could not be found.
Feb 29 2020 01:47 AM
Dec 07 2020 11:25 PM
@otaconjh , This usually occurs due to proxy server. I have encountered same error. Please try bypassing the proxy server and check if it works.
Regards,
Azhar.
Mar 11 2022 12:18 AM - edited Mar 11 2022 12:30 AM
Hi all , I have the same problem, when downloading a PowerShell module from our 'own' Nexus repository.
PowerShell version is built-in 5.1 (5.1.17763.2268) for Windows 2019. Not using a proxy.
Note: I'm getting the same error in the verbose output:
VERBOSE: Completed downloading 'https://psrespository.mycompany.com/repository/corp_ps_nuget/MyTestModule/1.0.0'.
VERBOSE: Completed downloading 'MyTestModule'.
VERBOSE: Hash for package 'MyTestModule' does not match hash provided from the server.
And I have the following (ugly) workaround:
so this shows to me the nuget itself is not corrupt. it may have to do with the hash on the Nexus itself
Regards, Ben