winget-cli: Repair-WingetPackageManager not working as expected in system context

Brief description of your issue

Running “Repair-WingetPackageManager -Force -Latest” in the system context reports back that Winget is in a good state even though it is not up to date or in some instances, working at all. This is important as Intune and SCCM etc. run scripts in the system context not elevated admin. If I run the same command as admin it repairs / updates Winget as expected.

Steps to reproduce

.\PsExec.exe -i -s powershell Repair-WingetPackageManager -Force -Latest -Verbose

Expected behavior

Expect Winget to be repaired / updated from v1.6.3133 to latest

Actual behavior

VERBOSE: Creating MTA thread VERBOSE: WinGet is in a good state.

Environment

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

Windows: Windows.Desktop v10.0.19045.4046
System Architecture: X64

Winget Directories
------------------------------------------------------------------------------------------------------
Logs                               %TEMP%\WinGet\defaultState
User Settings                      %LOCALAPPDATA%\Microsoft\WinGet\Settings\defaultState\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

About this issue

  • Original URL
  • State: open
  • Created 4 months ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

OK. I believe I’ve got a clean repro.