Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Update-WinGetPackage command fails with an error #4136

Open
RalfReddings opened this issue Feb 2, 2024 · 4 comments
Open

The Update-WinGetPackage command fails with an error #4136

RalfReddings opened this issue Feb 2, 2024 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. PowerShell Issue related to WinGet PowerShell Module or cmdlet

Comments

@RalfReddings
Copy link

Brief description of your issue

I am not able to update installed packages by either piping package names to Update-WinGetPackage or using the command directly

Steps to reproduce

I am using the version 0.2.2 of winget.

Find-WinGetPackage Microsoft.VisualStudioCode -Source winget

Name                                      Id                                      Version Source
----                                      --                                      ------- ------
Microsoft Visual Studio Code              Microsoft.VisualStudioCode              1.86.0  winget
Microsoft Visual Studio Code Insiders CLI Microsoft.VisualStudioCode.Insiders.CLI 1.87.0  winget
Microsoft Visual Studio Code Insiders     Microsoft.VisualStudioCode.Insiders     1.87.0  winget
Microsoft Visual Studio Code CLI          Microsoft.VisualStudioCode.CLI          1.86.0  winget

Attempting to install the first one, Microsoft Visual Studio Code, returns an error (I think):

Find-WinGetPackage Microsoft.VisualStudioCode -source winget| Select-Object -First 1 | Update-WinGetPackage

CorrelationData    :
InstallerErrorCode : 0
ExtendedErrorCode  : System.Runtime.InteropServices.COMException (0x8A150002): 0x8A150002
RebootRequired     : False
Status             : InvalidOptions

Starting Code and checking about confirms that it was not updated. I also tried using Update-WinGetPackage directly, I end up with the same above issue:

Update-WinGetPackage Microsoft.VisualStudioCode -Source winget

CorrelationData    :
InstallerErrorCode : 0
ExtendedErrorCode  : System.Runtime.InteropServices.COMException (0x8A150002): 0x8A150002
RebootRequired     : False
Status             : InvalidOptions

Expected behavior

Update the visual studio code application

Actual behavior

I get an error (mentioned above)

Environment

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

Windows: Windows.Desktop v10.0.22621.2134
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.3133.0

Winget Directories
------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagO…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\setti…
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
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue need to be triaged label Feb 2, 2024
@RalfReddings RalfReddings changed the title Update-WinGetPackage The Update-WinGetPackage command fails with an error Feb 2, 2024
@stephengillie stephengillie added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Feb 2, 2024
@denelon
Copy link
Contributor

denelon commented Feb 2, 2024

We've released a newer version of the Microsoft.WinGet.Client PowerShell module:
https://www.powershellgallery.com/packages/Microsoft.WinGet.Client/1.6.3133.0

There were some changes/improvements in the WinGet COM APIs. Upgrading the module should address this issue.

@denelon denelon added PowerShell Issue related to WinGet PowerShell Module or cmdlet Needs-Author-Feedback Issue needs attention from issue or PR author labels Feb 2, 2024
@RalfReddings
Copy link
Author

@denelon

Hey thanks, I installed the new version you mentioned and tested. I just wanted to confirm that it too is suffering the same issue.

 Get-Module -name *wing*

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.6.3133.0            Microsoft.WinGet.Client             {Add-WinGetSource,

I updated Code earlier so I tried updating teracopy:

Get-WinGetPackage teracopy

Name     Id                  Version Available Source
----     --                  ------- --------- ------
TeraCopy CodeSector.TeraCopy 3.9.2   3.17      winget

And attempting to update it:

Get-WinGetPackage teracopy | Update-WinGetPackage

CorrelationData    :
InstallerErrorCode : 0
ExtendedErrorCode  : System.Runtime.InteropServices.COMException (0x80072EFD): 0x80072EFD
RebootRequired     : False
Status             : InternalError

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention Issue needs attention from Microsoft and removed Needs-Author-Feedback Issue needs attention from issue or PR author labels Feb 2, 2024
@Trenly
Copy link
Contributor

Trenly commented Mar 6, 2024

@RalfReddings - I was able to find a workaround by specifying -Property Id with the Select-Object

PS C:\Users\Trenly> Find-WinGetPackage Notepad++ -source winget| Select-Object -First 1| Update-WinGetPackage

Id                  Name      Source InstallerErrorCode Status         RebootRequired ExtendedErrorCode
--                  ----      ------ ------------------ ------         -------------- -----------------
Notepad++.Notepad++ Notepad++ winget 0                  InvalidOptions False          System.Runtime.InteropServices.C…

PS C:\Users\Trenly> Find-WinGetPackage Notepad++ -source winget| Select-Object -First 1 -Property Id| Update-WinGetPackage

Id                  Name      Source InstallerErrorCode Status RebootRequired ExtendedErrorCode CorrelationData
--                  ----      ------ ------------------ ------ -------------- ----------------- ---------------
Notepad++.Notepad++ Notepad++ winget 0                  Ok     False

@kdpuvvadi
Copy link

It's working on some packages but failing on some

$ Find-WinGetPackage Warp -source winget | Select-Object -Property Id -First 1 | Update-WinGetPackage  | Format-List

Id                 : Cloudflare.Warp
Name               : Cloudflare WARP
Source             : winget
CorrelationData    :
InstallerErrorCode : 0
ExtendedErrorCode  : System.Runtime.InteropServices.COMException (0x80070652)
RebootRequired     : False
Status             : InternalError

$ Find-WinGetPackage CMake -source winget | Select-Object -Property Id -First 1 | Update-WinGetPackage  | Format-List

Id                 : Kitware.CMake
Name               : CMake
Source             : winget
CorrelationData    :
InstallerErrorCode : 0
ExtendedErrorCode  :
RebootRequired     : False
Status             : Ok

@denelon denelon removed the Needs-Attention Issue needs attention from Microsoft label Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. PowerShell Issue related to WinGet PowerShell Module or cmdlet
Projects
None yet
Development

No branches or pull requests

5 participants