microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.22k stars 1.45k forks source link

The latest version of PowerShell module fails on PowerShell 5.1 #3842

Closed zbalkan closed 1 year ago

zbalkan commented 1 year ago

Brief description of your issue

The latest version of PowerShell module fails on PowerShell 5.1.

Could not find Windows Runtime type 'Microsoft.Management.Deployment.PackageFieldMatchOption'

Steps to reproduce

Install-Module -name Microsoft.Winget.Client -Verbose

Expected behavior

Get-WingetPackage

Name Id
Microsoft Threat Modeling Tool 7a3fbc4bf1198e6f
Visual Studio Community 2022 Microsoft.VisualStudio.2022.Community
Adobe Acrobat Reader AdobeAcrobatReaderCoreApp_pc75e8sa7ep4e
Microsoft Teams Microsoft.Teams
Microsoft Edge Microsoft.Edge
Microsoft Edge Update Microsoft Edge Update
Microsoft Edge WebView2 Runtime Microsoft.EdgeWebView2Runtime
Microsoft Help Viewer 2.3 Microsoft Help Viewer 2.3
Cortana Microsoft.549981C3F5F10_8wekyb3d8bbwe
AV1 Video Extension Microsoft.AV1VideoExtension_8wekyb3d8bbwe
App Installer Microsoft.DesktopAppInstaller_8wekyb3d8bb…
Get Help Microsoft.GetHelp_8wekyb3d8bbwe

Actual behavior

get-wingetPackage : Could not find Windows Runtime type 'Microsoft.Management.Deployment.PackageFieldMatchOption'. At line:1 char:1

Environment

Windows Package Manager v1.6.2771
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3570
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.2771.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
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
denelon commented 1 year ago

Duplicate of #2881

microsoft-github-policy-service[bot] commented 1 year ago

Hello @zbalkan,

We've identified this as a duplicate of another issue or PR that already exists. This specific instance is being closed in favor of the linked issue. Please add your 👍 to the other issue to raise its priority. Thanks for your contribution!

Template: msftbot/duplicate/closed