Skip to main content

Installed software via PowerShell

 

 

Query registry for installed software

There's more data in each registry than is being displayed in the PowerShell Custom Objects output be the script below. You can inspect $InstalledSoftware for further details.

# HKEY_Local_Machine
$HKLM_InstalledSoftware = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall"
$HKLM_PrettyList = foreach ($obj in $HKLM_InstalledSoftware) {
  [PSCustomObject]@{
    Name = ($obj.Name).Split('\')[-1]
    DisplayName = $obj.GetValue('DisplayName')
    DisplayVersion = $obj.GetValue('DisplayVersion')
    Publisher = $obj.GetValue('Publisher')
    InstallLocation = $obj.GetValue('InstallLocation')
  }
}
$HKLM_PrettyList | Sort-Object -Property Publisher,Name | Select-Object -Property DisplayName,Publisher,InstallLocation,Name

The above information does not include software installed to the current logged in user. Just change the hive that's being queried as shown below:

# HKEY_Current_User
$HKCU_InstalledSoftware = Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall"
$HKCU_PrettyList = foreach ($obj in $HKLM_InstalledSoftware) {
  [PSCustomObject]@{
    Name = ($obj.Name).Split('\')[-1]
    DisplayName = $obj.GetValue('DisplayName')
    DisplayVersion = $obj.GetValue('DisplayVersion')
    Publisher = $obj.GetValue('Publisher')
    InstallLocation = $obj.GetValue('InstallLocation')
  }
}
$HKCU_PrettyList | Sort-Object -Property Publisher,Name | Select-Object -Property DisplayName,Publisher,InstallLocation,Name