How to Show Windows Updates by Command Line?

There are several methods mentioned in the internet:

Method Comment
systeminfo.exe Doesn’t show all packages that are installed, quite surely.
wmic.exe qfe get hotfixid |sort Shows the same packages as systeminfo.
in Powershell: Get-HotFix | Sort-Object HotFixID Shows the same as the tools above.
dism /online /get-packages /english Finds a lot of packages but not the KB number for all of them. Some KB numbers showing up in the commands above don’t show up here.

As these tries did not work out well and the Windows-i/Updates/Update history is not searchable well, I tried other ways:

NirSoft’s WinUpdatesView

NirSoft’s WinUpdatesView

  • It is freeware. It is quite good, but it also does not show the same information as Windows/Update history
  • It shows also attempts to install an update with date and current state (failed, succeeded, in progress).
  • It’s got a search function (Ctrl-f).
  • And a quick filter function (Ctrl-q). With this you can filter only for succeeded or failed attempts.
  • You can sort the view by any of the many columns.
  • You can save the history to a text or csv by starting WUV with the parameters /scomma filename.
  • Minus: for me, it does not show anything older than 31. March 2021. Windows/Update history shows older packages.

Via Registry

The following method I did find also, I have not yet tested it.

In the registry under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages, each key represents an update.
For each update there is a list with values and CurrentState shows the state of the update. These are the decimal values that can occur:

Decimal Meaning German
0 absent nicht installiert
5 uninstallation pending
16 resolving ermitteln
32 resolved ermittelt
48 staging aktualisieren
64 staged akutalisiert
80 superseded ersetzt
96 install pending
101 partially installed
112 installed
128 permanent