I found that WMIC doesn't get all installed software because it takes information from some specific/default registry as unique, and that registry alone doesn't contain the full list of software shown on Control Panel.
I found that this Powershell command line DO FIND the software installed listed-and-not-listed by wmic:
Get-ItemProperty HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | select DisplayName, DisplayVersion, InstallDate
BUT, I need to add a FILTER to that line (and I'm sorry I don't know Powershell that deep) to filter for specific name, i.e. 'Teamv', so it shows me ONLY software that start/contain that word, so I can find out if the software is installed or not.
IF (IF) also there exist a way to get from a list of words (let say you want to find out more that one software installed,i.e. Teamviewer, Kaspersky and Logmein) that would be awesome!!
Thanks for any help ! =)
PowerShell offers the
Where-Objectcmdlet for filtering a list of objects - wether as a whole or by property values:Note:
A 64-bit version of Windows is assumed, where you need to check two registry keys: one for 64-bit, and another for 32-bit applications (
Wow6432Node).PSPathto theSelect-Objectcall (the values of that property have a PowerShell-specific provider prefix; to get the registry-native key path, pass these values toConvert-Path).The above, due to involving only a single comparison operation, was able to employ simplified syntax; that is,
Where-Object DisplayName -match 'Teamviewer|Kaspersky|LogMeIn'is the simplified form of the following, script block-based form ({ ... }), in which the pipeline input object must be referred to via the automatic$_variable; you need this form for more complex conditionals:That is, the
.DisplayNameproperty value of each pipeline input object is compared to a regex (regular expression),'Teamviewer|Kaspersky|LogMeIn', using the-matchoperator.$true(possibly by type coercion; here,-matchdirectly returns$trueor$false)-match:|) makes it look for any of the three strings; using additional regex constructs (such as^to match only at the start of the input string) would be possible in order to further constrain the matching logic.-cmatchvariant for case-sensitive matching.