-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-Products replaced with faster and better version #126
base: master
Are you sure you want to change the base?
Conversation
This does not produce an equivalent output. PS > (gwmi Win32_Product).Count
320
PS > (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*).Count
124 |
Thats because on 64 bit there is actually two keys. Forgot about that. I fixed it now. $a = Get-WmiObject Win32_Product | select -ExpandProperty Name
$a.Count
65
$c = Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
| select -ExpandProperty DisplayName -ErrorAction SilentlyContinue
$c += Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' | select -ExpandProperty DisplayName -ErrorAction SilentlyContinue
$c.Count
134 |
I'm not getting anything close to consistent equivalent output either. Tested on Windows 7, PS4: Running the above code from @exp0se: $a = Get-WmiObject -Class Win32_Product | Select -ExpandProperty Name
$a.Count
292
$a = Get-WmiObject -Class Win32_Product
$a.Count
292
$b = Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
| select -ExpandProperty DisplayName -ErrorAction SilentlyContinue
$b += Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
| select -ExpandProperty DisplayName -ErrorAction SilentlyContinue
$b.count
532 |
Well, they are not going to be consistent because Win32_Product doesn't list everything installed, only stuff installed via Windows Installer. On my box it missed more than half of the programs that actually installed. |
Do these keys report on installed "Universal" apps as well, or just desktop versions? This would apply to Windows 8/2012/10 OSes. |
The current Get-Products.ps1 collector says in the .SYNOPSIS that it only covers products installed via Windows Installer. I like this change that you've submitted. I'm curious why not all of the objects have a DisplayName field. I want to dig into this a bit more before committing the change. Thanks for the contribution. |
I manually looked through the sub keys to explain blanks also, and some subkeys don't have all the fields we would expect to see (AddressBook, ConnectionManager). I expanded on the properties (and used Out-GridView 'ogv') to look at the results. There may be some cool analysis things that can be done with this, and maybe just toss out or supress the blanks for now? Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' | Select DisplayName, DisplayVersion, Publisher, InstallDate, HelpLink, UninstallString | ogv |
If you add |
I replied via GitHub, but I don't think it went out via email. I'm On Wed, Aug 19, 2015 at 11:31 AM, Juan Romero [email protected]
|
What is the progress status of this feature? Does it require additional work? I am in need of a similar feature. If it does let me know. |
WMI is too slow, it is showing only MSI installed packages and it is dangerous to use because it runs consistency check and package repair when you query it. Don't use it.
http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/13/use-powershell-to-quickly-find-installed-software.aspx