Powershell is the greatest thing to ever fall in front of the human race. I’ll repeat it over and over again.
Today I heard a cry for help.
“Help me! Help me! I need to list all my installed Applications in Windows 7! And I need to do it with Powershell!”
Always willing to lend a helping hand, the Energized Tech flies down.
“What’s the matter little man?”
“I Need a way to list all my installed applications in Powershell in Windows 7! I need it now! I need it Quick! Or I’ll find myself doing nothing but testing badly designed and poorly assembled hardware for the rest of my life! Help me!”
The task was easy. The challenge simple.
You see in Powershell, you can navigate the Registry as simply as the file system by specifying
REGISTRY:: and the Key name under
So just as GETCHILDITEM C:
Will list C: Drive
Will list all the keys in that location
“Why I’ll just get myself a handy GET-CHILDITEM on REGISTRY::HKEY-LOCAL-MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall and DUMP the list of installed applications! TADA!”
Ahah, but I forgot two key details.
One. Not all programs name that key with the Program name sometimes they use a pretty SID to identify it and
Two. You can’t view the ITEMS in the registry keys with a GET-CHILDITEM, just the keys.
My hopes sank. Not so easy. And this poor helpless lad clad only in his Tilley hat would be confined to a lifetime of testing shoddy hardware.
But then a voice. An answer.
A well researched article written by a Powershell Guru about navigating the Registry with Powershell from Powershell.com. The article explained you have to use a “Get-ItemProperty” on those “Items” to see their values.
And so the answer was actually VERY each. Just a little extra code. Not even much at that.
Assign the results the GET-CHILDITEM to a variable.
$LIST=GET-CHILDITEM on REGISTRY::HKEY-LOCAL-MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall
then run a FOREACH on each item in the list pulling out the DisplayName (which *IS* the value under each uninstall KEY entry showing the programs True Name.
# A LITTLE APP THAT FOR NO OTHER REASON DUMPS ALL THE PROGRAMS INSTALLED ON YOUR PC
Foreach ($App in $list)
And now our poor fellow in Distress can happily sit down and enjoy a cold brew. Happy and Stress Free
The Energized Tech
”I Love Powershell”