I want to uninstall a program. There can be several versions of this program installed at the same time. I want to uninstall them with the uninstall string from the registry.
I need to get the subkeys of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall which contain the words "jump client" and "cloud". If the name of the subkey contains these words, then I need to get the Display Name and the Uninstall String. The Display Name also contains these two words.
For example: I need the Uninstall String and Display Name of "123-Jump Client – 189.38-cloud" and the Uninstall String and Display Name of "245-Jump Client – 184-cloud".
I tried
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"|Where-Object {$_.DisplayName -contains "jump client" -and $_.DisplayName -contains "cloud"}
That does not work.
Thanks!
Complementing Theo's helpful answer, you may already filter by using wildcards for the -Path
argument of the Get-ItemProperty
command:
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*Jump Client*cloud" |
Select-Object DisplayName, UninstallString
In case the software is 32-bit, then on a 64-bit Windows, you'd have to search in the 32-bit view of the registry:
Get-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*Jump Client*cloud" |
Select-Object DisplayName, UninstallString