HI Jeffrey. That's nice but you forgot there's atleast 2 other registry keys you need to list! How do you do that with one line so all the results are sortable in Out-GridView. I'd be very excited to learn this.
I get vastly different results using that (330 items with WMI and 937 items with the registry), and the WMI approach is much slower. Don't know how to account for the differences, but the WMI approach should be giving proper results.
I haven't yet found a way to get exactly the results I get in Programs and Features.
Get-WmiObject -Class Win32_Product doesn't list some of the programs that are listed in Programs and Features for example. I've read some installer put themself just into the Uninstall registry key and not into places where Win32_Product looks.
I suspect closer results would be possible by adding some filtering to the registry key approach by using some of the values under the Uninstall key. It still does not answer the big question, where does Programs and Features get the InstallDate from? It has that date for apps which I can't find any date in the registry keys for. I tried checking the Uninstaller file dates, they can also be different than what's shown in Programs and Features. (win7 64)
Based on the documentation for the Win32_Product object, they are only MSI installed applications. Same with you, I was trying to filter the registries and it's working well for me actually. What I'm trying to do now is remove some identical software's in my output.
@androidi:Raymond Chen has blogged about this in the past sometime, so searching his blog might help. From what I recall the Add/Remove Programs control panel uses heuristics to try and guess various bits of information such as the install date, size, etc if they aren't present in the registry (this is one of the reasons it takes so long to populate the list), so it could well be doing anything (searching for Start Menu shortcuts with a similar name is probably a good bet)
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.