microsoft / microsoft/winget-cli
The PowerShell module `Microsoft.WinGet.Client:1.12.440` cannot be installed in Windows PowerShell
Open
Nobody has claimed this yet.
Issue-Bug
PowerShell
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Relevant area(s)
PowerShell Module
Relevant command(s)
No response
Brief description of your issue
- The PowerShell module
Microsoft.WinGet.Client:1.12.440cannot be installed in Windows PowerShell.
Steps to reproduce
- Open
Windows PowerShellin 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 -Forceresults 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.460doesn't cause this problem. In other words, specifying1.11.460eliminates 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two Install-Module commands in Windows PowerShell in the Windows Sandbox, comparing Microsoft.WinGet.Client versions 1.12.440 and 1.11.460. Investigate the PowerShellGet/PackageManagement installation path and compare it with the working Install-PSResource path; done means version 1.12.440 installs successfully without the central-directory error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100