Monday, August 24, 2009

PowerShell: Get Information About Installed Applications Without Using WMI

From: How to Get Information About Installed Applications Without Using WMI by Alex K. Angelopoulos

In PowerShell, the simplest way to display the [Installed Applications] is to use the Get-ChildItem cmdlet (which has the alias of gci), then pipe its results to the Get-Item- Property cmdlet. (Get-ChildItem doesn’t retrieve information about the registry values contained within subkeys; it only lists the subkeys’ names.) So, the command that you’d enter in the PowerShell window would be

gci “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” |ForEach-Object{Get-ItemProperty $_.PSPath}

I changed the syntax a bit, and here’s what I prefer:

dir HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall | ForEach { Get-ItemProperty $_.PSPath} | Select DisplayName,InstallDate, DisplayVersion | Sort DisplayVersion, Installdate | Format-Table * -auto  

The ability to change the sort order is handy for software inventory(When was that app installed?) and version troubleshooting, and


| Format-Table * –auto

”AutoFits” column widths.

PowerShell_02

2 comments:

ashish said...

Thank you so much !! this is what is was looking for hours !!! appreciate it !!!

ashish said...

Thank you so much, really appreciate !! it works great !!