Skip to content

Winget PowerShell commands failing #3805

Closed
Closed

Description

@RygelXVI

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           Disabled

Activity

  1. Trenly commented on Oct 23, 2023

    @Trenly
    Contributor

    What version of PowerShell are you using?

  2. added
    Issue-Bug
    PowerShell
    and removed
    Needs-Triage
    on Oct 23, 2023
  3. RygelXVI commented on Oct 24, 2023

    @RygelXVI
    Author

    I'm using PowerShell 7.3.8, behaviour is also the same on 7.3.7

  4. AmirTerani commented on Oct 24, 2023

    @AmirTerani

    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!

  5. mdanish-kh commented on Oct 25, 2023

    @mdanish-kh
    Contributor

    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)

    Note: If you want the MSI installer of PowerShell, you can get it using winget download Microsoft.PowerShell --installer-type wix

  6. RygelXVI commented on Oct 25, 2023

    @RygelXVI
    Author

    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 -Verbose and -Debug switches not return any further information?

  7. AmirTerani commented on Oct 25, 2023

    @AmirTerani

    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!

  8. eabase commented on Oct 28, 2023

    @eabase

    Seem related to #3826

  9. jaimecbernardo commented on Jan 9, 2024

    @jaimecbernardo

    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

  10. Logue-0 commented on Jan 25, 2024

    @Logue-0

    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

    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

  11. Neme12 commented on Mar 2, 2024

    @Neme12

    Damn, MSIX is still a second-class citizen, even today? :(

  12. 6 remaining items

  13. dongle-the-gadget commented on Aug 6, 2024

    @dongle-the-gadget

    Should we closed this? Seems like it's fixed.

  14. removed
    Needs-Author-Feedback
    on Aug 6, 2024
  15. moved this from Done to Released in WinGeton Oct 28, 2024
  16. sebbu2 commented on Sep 20, 2026

    @sebbu2

    seems to bug again on 7.6.6 (from windows store)

  17. nwx-natew commented on Sep 22, 2026

    @nwx-natew

    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

  18. ihatecreatingusernames commented on Sep 24, 2026

    @ihatecreatingusernames

    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.

  19. drewjc75 commented on Sep 24, 2026

    @drewjc75

    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.

    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.Client fixed it for me. Latest version is 1.29.380, what version are you running?

  20. jsec02 commented on Sep 26, 2026

    @jsec02

    I'm getting this error in administrator contexts with version 1.29.280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugPowerShell

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions