0
Get-WmiObject -Class Win32_Product  | where-object { $_.name -like "*OfficeScan*" }  

Shows me the wrong version number of the TrendMicro OfficeScan Client - the default Version 12.0.1222 when the installed version is 12.0.4430.

I also tried:

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |  Select-Object DisplayName, DisplayVersion, Publisher, InstallDate 

There it doesnt show up at all. It's weird because in the old systemcontrol if i go to deinstallation it shows the correct version:

deinstallation

So I need to somehow extract the information of the actual version to my powershell. I need it for a auto update feature, it has to be using powershell.

1 Answer 1

2

Assuming you're using a 64bit system, you're looking in the wrong place in the registry.

I don't have TrendMicro, so using Adobe Reader as an example:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Where-Object { $_.DisplayName -like "*Adobe Reader*" } |
    Select-Object DisplayName, DisplayVersion

If you just want a numerical Version property to use as a comparison, update:

Select-Object -Expand DisplayVersion
Sign up to request clarification or add additional context in comments.

2 Comments

It worked thank you, can you explain to me what the difference is? Between HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ and HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\
Check the link in my answer as it explains that :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.