Get-WinGetPackage in 1.29.380 fails with "Failed to create instance: -2147023174" in an elevated PowerShell session
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
The issue is in the PowerShell module Microsoft.WinGet.Client, specifically the Get-WinGetPackage command. Start by examining the COM interop code in the module that creates the instance, likely in the GetPackageCmdlet class. Compare the changes between versions 1.29.280 and 1.29.380 to identify what broke elevated session support. Test the fix in an elevated PowerShell session on Windows Server 2025 to confirm the error is resolved.
由索引模型根据 Issue 内容生成。
描述
Relevant area(s)
PowerShell Module
Relevant command(s)
Get-WinGetPackage. I did not test other commands, so those might be affected as well.
Brief description of your issue
Get-WinGetPackage in 1.29.380 fails with "Failed to create instance: -2147023174" in an elevated PowerShell session.
Steps to reproduce
In an elevated PowerShell session (tested with Windows Server 2025, the built-in Administrator account and the built-in PowerShell version):
Uninstall-Module Microsoft.WinGet.Client
Install-Module -Name Microsoft.WinGet.Client -RequiredVersion 1.29.280
Get-WinGetPackage
Note that Get-WinGetPackage outputs the list of installed packages. Now let's try the same with 1.29.380:
Uninstall-Module Microsoft.WinGet.Client
Install-Module -Name Microsoft.WinGet.Client -RequiredVersion 1.29.380
Get-WinGetPackage
Expected behavior
Get-WinGetPackage behaves like in 1.29.280.
Actual behavior
Get-WinGetPackage : Failed to create instance: -2147023174
At line:1 char:1
+ Get-WinGetPackage
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-WinGetPackage], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.WinGet.Client.Commands.GetPackageC
mdlet
Get-WinGetPackage works in a non-elevated PowerShell session.
Reverting to 1.29.280 (see above) fixes the issue.
Environment
Windows Package Manager v1.11.510
Windows: Windows.Server v10.0.26100.32522
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.26.510.0
- 主要语言
- C++
- 星标
- 26.6k
- 派生
- 1.8k
- 平均合并
- 3 天 10 小时
- 30 天内合并 PR
- 41
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/winget-cli 的其他 Issue
-
Issue-Docs Needs-Triage
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/winget-cli#6692 ·
维护者通常 2 天内回复
-
Issue-Docs Possible-Duplicate
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/winget-cli#6493 · 1 条评论 ·
维护者通常 2 天内回复
-
Issue-Feature
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/winget-cli#6427 ·
维护者通常 2 天内回复
-
Issue-Docs msstore
难度 2/5 1-3 小时 新手友好度 64/100
microsoft/winget-cli#6331 · 1 条评论 ·
维护者通常 2 天内回复
-
Command-Source Issue-Bug
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/winget-cli#6148 ·
维护者通常 2 天内回复
查看 microsoft/winget-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
stratum-mining/sv2-tp#167 ·
维护者通常 1 天内回复
-
Sign up button opens the Sign in page instead of the Sign up page for Enterprise edition servers未关闭auth bug ui/ux
难度 2/5 1-3 小时 新手友好度 72/100
MerginMaps/mobile#4795 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
HarperFast/rocksdb-js#1118 ·
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
26.04 bug dark-mode Easy Hack impress symptom: visual
难度 2/5 1-3 小时 新手友好度 68/100
CollaboraOnline/online#16421 · 1 条评论 ·