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
22.55k stars 1.4k forks source link

In and non-admin env the winget upragre --scope uses does not work #4380

Closed alanlivio closed 2 months ago

alanlivio commented 2 months ago

Brief description of your issue

I am in annon-admin env and want to upgrade only user-scoped packages. So I imagined that winget upgrade --scope user would work, but it only lists the packages upgradable in that scope.

Steps to reproduce

$ winget upgrade --scope user

Expected behavior

Install upgrade for the all packages in the user scope.

Actual behavior

$ winget upgrade --scope user
Name            Id                   Version     Available            Source
----------------------------------------------------------------------------
PowerShell      Microsoft.PowerShell 7.2.6.0     7.4.2.0              winget
Microsoft Teams Microsoft.Teams      1.7.00.7956 24060.2623.2790.8046 winget
2 upgrades available.

Environment

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

Windows: Windows.Desktop v10.0.22621.3296
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.10861.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
denelon commented 2 months ago

Are you logged in as a user or is this running in the system context (session 0)?

alanlivio commented 2 months ago

Thanks @danelon. I just log in as a normal non-admin user, start Windows Powershell, and run the winget upgrade --scope user

denelon commented 2 months ago

You should be able to append "--all" and it should only upgrade the --user installed packages.

alanlivio commented 2 months ago

Many thanks. It worked.