Skip to content

The PowerShell module Microsoft.WinGet.Client:1.12.440 cannot be installed in Windows PowerShell #6017

@linghengqian

Description

@linghengqian

Relevant area(s)

PowerShell Module

Relevant command(s)

No response

Brief description of your issue

  • The PowerShell module Microsoft.WinGet.Client:1.12.440 cannot be installed in Windows PowerShell.

Steps to reproduce

  • Open Windows PowerShell in the Windows Sandbox and execute the following command:
Install-PackageProvider -Name NuGet -Force
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion 1.12.440 -Force

Expected behavior

  • No error message was displayed.

Actual behavior

  • Executing Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion 1.12.440 -Force results in the following error:
PackageManagement\Install-Package : Package 'Microsoft.WinGet.Client' failed to be installed because: End of Central Di
rectory record could not be found.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (Microsoft.WinGet.Client:String) [Install-Package], Exception
    + FullyQualifiedErrorId : Package '{0}' failed to be installed because: {1},Microsoft.PowerShell.PackageManagement
   .Cmdlets.InstallPackage

  • The funny thing about this is that Microsoft.WinGet.Client:1.11.460 doesn't cause this problem. In other words, specifying 1.11.460 eliminates the error.
Install-PackageProvider -Name NuGet -Force
Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -RequiredVersion 1.11.460 -Force
  • Even more ridiculous is that I can solve this problem by manually installing Install-PSResource/Microsoft.PowerShell.PSResourceGet.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
Install-PackageProvider -Name NuGet -Force
Install-Module Microsoft.PowerShell.PSResourceGet -Repository PSGallery -Force
Install-PSResource -Name Microsoft.WinGet.Client -Repository PSGallery -TrustRepository

Environment

- Installation not completed; cannot be provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIt either shouldn't be doing this or needs an investigation.PowerShellIssue related to WinGet PowerShell Module or cmdlet

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions