Repository navigation
Closed
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.PowerShellIssue related to WinGet PowerShell Module or cmdlet
Milestone
Description
Brief description of your issue
attempting to use any winget powershell commands will fail with "Get-WinGetPackage: Failed to create instance: -2147483633"
using Get-WinGetPackage -Verbose -Debug does not produce further information.
using try { get-wingetpackage } catch { $_.exception } captures the following stacktrace:
ErrorCode : -2147483633
TargetSite : T Create[T](System.Type, System.Guid ByRef)
Message : Failed to create instance: -2147483633
Data : {}
InnerException :
HelpLink :
Source : Microsoft.WinGet.Client.Engine
HResult : -2147483633
StackTrace : at Microsoft.WinGet.Client.Engine.Helpers.ComObjectFactory.Create[T](Type type, Guid& iid)
at
Microsoft.WinGet.Client.Engine.Helpers.ComObjectFactory.CreateCreateCompositePackageCatalogOptions()
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.GetPackageCatalogReference(Composit
eSearchBehavior behavior)
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.GetPackageCatalog(CompositeSearchBe
havior behavior)
at
Microsoft.WinGet.Client.Engine.Commands.Common.FinderCommand.FindPackages(CompositeSearchBehavior
behavior, UInt32 limit)
at Microsoft.WinGet.Client.Engine.Commands.Common.FinderExtendedCommand.FindPackages(CompositeSearc
hBehavior behavior)
at Microsoft.WinGet.Client.Engine.Commands.FinderPackageCommand.Get()
at Microsoft.WinGet.Client.Commands.GetPackageCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
Steps to reproduce
use a winget powershell command, e.g.
get-wingetpackage | where { $_.Isupdateavailable }
Expected behavior
a list of packages with updates available to be displayed in the shell (in fact the same list of packages that would be displayed using winget upgrade
Actual behavior
error message "Get-WinGetPackage: Failed to create instance: -2147483633" is returned
Environment
Windows Package Manager (Preview) v1.7.2782-preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.22621.2428
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.2782.0
Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User) %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root C:\Program Files\WinGet\Packages
Portable Package Root (x86) C:\Program Files (x86)\WinGet\Packages
Installer Downloads %USERPROFILE%\Downloads
Links
---------------------------------------------------------------------------
Privacy Statement https://aka.ms/winget-privacy
License Agreement https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale
Admin Setting State
--------------------------------------------------
LocalManifestFiles Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride Disabled
LocalArchiveMalwareScanOverride DisabledReacted by Muhammad Danish, Matt and jsec02
Reacted by Sigurd Schoeler, Matt and jsec02
Metadata
Metadata
Assignees
Labels
Issue-BugIt either shouldn't be doing this or needs an investigation.PowerShellIssue related to WinGet PowerShell Module or cmdlet
Activity
Trenly commentedon Oct 23, 2023
What version of PowerShell are you using?
RygelXVI commentedon Oct 24, 2023
I'm using PowerShell 7.3.8, behaviour is also the same on 7.3.7
AmirTerani commentedon Oct 24, 2023
Ran into a similar issue. Got the same "Failed to create instance: -2147483633" error with v0.2.2 but only when running Find-WingetPackage command in a script that was launched from an Scheduled Task with the Run whether user is logged on or not box checked on a Windows 10 workstation! Very unique! It worked properly in interactive sessions and in Windows 11. Downgrading the module to v0.2.1 didn't change anything, but then downgrading to v0.2.0 seems to have fixed the issue at first but it happened later on when I tried it again!
mdanish-kh commentedon Oct 25, 2023
This looks like a problem with the MSIX-installed (user-scoped) version of PowerShell. Running it through the MSI-installed (machine-scoped) powershell works for me
output.mp4
cc Demitrius Nelon (@denelon)
RygelXVI commentedon Oct 25, 2023
on this (work) computer, PowerShell was installed from the Microsoft Store.
I don't see this problem on my personal computer, where PowerShell was installed with WinGet.
Can anyone clarify why there are issues between how PowerShell is installed? This seems very strange to me. Also why does using the
-Verboseand-Debugswitches not return any further information?AmirTerani commentedon Oct 25, 2023
I just uninstalled PS7 MSIX and manually downloaded and installed the MSI package. Still getting the same error when run the script from an Scheduled Task. Works fine in the console! Very odd!
eabase commentedon Oct 28, 2023
Seem related to #3826
jaimecbernardo commentedon Jan 9, 2024
In PowerToys, we're using https://www.powershellgallery.com/packages/Microsoft.WinGet.Client/1.6.3133.0 as a dependency on a new utility: Command Not Found. Unfortunately the plugin doesn't work on PowerShell when installed from the Microsoft Store or from .msix.
Ref: microsoft/PowerToys#30818
Logue-0 commentedon Jan 25, 2024
Is there a third installation method that IS supported, then? I'm on Win11 and I'm trying to get it to work but I don't know how to update the bundled Powershell to version 7.**, just install the newer version as an MSIX
Neme12 commentedon Mar 2, 2024
Damn, MSIX is still a second-class citizen, even today? :(
6 remaining items
dongle-the-gadget commentedon Aug 6, 2024
Should we closed this? Seems like it's fixed.
sebbu2 commentedon Sep 20, 2026
seems to bug again on 7.6.6 (from windows store)
nwx-natew commentedon Sep 22, 2026
Seeing this on two separate Windows 11 systems where PowerShell was installed from the winget packages. Both have PowerToys installed if it matters.
Installer:
Installer Type: msix
Installer Url: https://github.com/PowerShell/PowerShell/releases/download/v7.6.6/PowerShell-7.6.6.msixbundle
Installer SHA256: ad992bc654ad8e6fa7070baedfbc0edbf8cab5b6bcb4f9f7a891fd2438fafe4b
Release Date: 2026-09-08
Offline Distribution Supported: true
ihatecreatingusernames commentedon Sep 24, 2026
I started getting "Failed to create instance: -2147023174" in FFU Builder after upgrading PowerShell 7 from v7.6.5 MSI to v7.6.6 MSI. Downgrading does not resolve the issue. PowerToys is not installed.
drewjc75 commentedon Sep 24, 2026
I was getting this error for a couple of days, but for some reason it was only happening when I ran PowerShell in admin context. Turns out I was massively out of date on the version of Microsoft.WinGet.Client, and running
Update-Module Microsoft.WinGet.Clientfixed it for me. Latest version is 1.29.380, what version are you running?jsec02 commentedon Sep 26, 2026
I'm getting this error in administrator contexts with version
1.29.280