2

Using PowerShell, I am looking to collect installed applications. This appears to be most-thoroughly accomplished by parsing the "Uninstall" section of the registry here:

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\

AND

HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\

A simple PowerShell to parse the data and throw it in tabular format for just one of these could be:

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* 
| Select-Object DisplayName, DisplayVersion 
| Sort-Object DisplayName | Format-Table  -AutoSize

What I would like to do, instead of having to run the above line to get both x86 and x64 installed applications, would be to combine both into the same output. Is there simple solution to this that would allow the same line to parse both registry keys and combine the data into a single table?

Beems
  • 801
  • 2
  • 13
  • 33

1 Answers1

6

See: Get-Help Get-ItemProperty and notice that Path is a string array

Get-ItemProperty [[-Path] <String[]>]

That means (like many commands) you can pass in multiple paths. For example:

Get-Itemproperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select DisplayName

From this, you can get all the rest of the answer you are looking for.

Kory Gill
  • 6,993
  • 1
  • 25
  • 33
  • Wow, that's amazing and exactly the answer I was 'hoping' to get yet not expecting. Thank you so much. – Beems Oct 06 '17 at 13:02