Create Software Inventories

by May 12, 2020

The Windows registry stores the names and details of all software that you installed. PowerShell can read this information and provide you with a complete software inventory:

# read all child keys (*) from all four locations and do not emit
# errors if one of these keys does not exist
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
                    'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
                    'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*',
                    'HKCU:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' -ErrorAction Ignore |
# list only items with the DisplayName
Where-Object DisplayName |
# show these registry values per item
Select-Object -Property DisplayName, DisplayVersion, UninstallString, InstallDate |
# sort by DisplayName
Sort-Object -Property DisplayName 

If you’d like to add more information, i.e. whether software is 32- or 64-bit, or if you’d like to turn the code into a reusable new PowerShell command, there is more reading for you here: https://powershell.one/code/5.html.


Twitter This Tip! ReTweet this Tip!