Using Winget to Identify Apps to Update, Remove or Install

What

Winget is a command line tool to manage applications on the Windows 10 and 11 platform.

When/Why

We've already covered how to install, upgrade, and remove packages on our endpoints.  You'll find those articles herehere and here respectively.  But sometimes we are going to want to do things out of the box.  Maybe we just want information on what is installed in this manner.  Or maybe we want to know about all apps that are available for upgrade.  Or maybe we even want to uninstall something we didn't install in the first place.

How

Thankfully winget has a command that helps us with all these things.  The winget "list" command will by default show you all applications that can be managed with winget and also show you if any of them need updated.  The usage is simply winget list, but if we run it through FileWave (to feed a custom field for instance), we still need to acount for our pre-requisites:

# because we run this from system account, we must define where winget is...the registry tells us
$winget_locale=Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winget.exe" -Name Path -ErrorAction SilentlyContinue

# we change directory to this locale so we can run the winget command without the full path
cd $winget_locale.Path

# adding the authorization acceptance here is superfluous if it has already been accepted, but it won't harm anything to include
./winget list

Output of the command will look something like this: