Windows: Manage applications with winget

Hi,

winget is a new tool from microsoft which acts as a package manager like apt, zypper or yum.

Installing winget (latest version on 26.01.2021 is 0.2.3162 Preview)

Download Microsoft.VCLibs.140.00_14.0.29231.0_x64__8wekyb3d8bbwe.appx, Microsoft.VCLibs.140.00.UWPDesktop_14.0.29231.0_x64__8wekyb3d8bbwe.appx and the latest release of winget

PS D:\> Add-AppxPackage .\Microsoft.VCLibs.140.00_14.0.29231.0_x64__8wekyb3d8bbwe.appx
PS D:\> Add-AppxPackage .\Microsoft.VCLibs.140.00.UWPDesktop_14.0.29231.0_x64__8wekyb3d8bbwe.appx
PS D:\> Add-AppxPackage .\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.appxbundle

Open a command shell (cmd.exe) or powershell
To search for an application use

PS D:\> winget search python

List all versions of an application

PS D:\> winget search python
Name                        ID                             Version  
------------------------------------------------------------------
Python                      Python.Python                  3.9.1

Install a package

PS D:\> winget show python --versions
FoundPython [Python.Python]
Version
-------
3.9.1
3.9.0
3.8.7
3.8.6

Install the latest version of a package

PS D:\> winget install python

Or in a specific version.

PS D:\> winget install python -v 3.8.6

This starts the installer in foreground. If you want to perform a silent installation add the –silent switch

PS D:\> winget install python -v 3.8.6 --silent

In the current release the upgrade and (installed) list commands are marked as experimental. You must enable it if you want to use it

PS D:\> winget features
Function                State    Property
-----------------------------------------------------
Microsoft Store Support disabled experimentalMSStore 
List Command            disabled list                
Upgrade Command         disabled upgrade    

To enable experimental features you must create a settings.json file. Simply call

PS D:\> winget settings

and open it with an editor of your choice(if no additional editor is installed use notepad). This creates a file

C:\Users\%UserName%\AppData\Local\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Possible settings can be found here.
So add

"experimentalFeatures": {
"experimentalCmd": true,
"experimentalArg": true
},

to the settings.json. Then this looks like


{ 
    "$schema": "https://aka.ms/winget-settings.schema.json",
   "experimentalFeatures": {
       "list": true,
       "upgrade": true
   },
}

and the experimental features are enabled

PS D:\> winget
  install
  show
  source
  search
  list
  upgrade
  hash
  validate
  settings
  features

To list all installed applications

PS D:\> winget list


to be continued…

Michael

Leave a Reply