Author Posts

July 12, 2016 at 11:57 pm

I guess it is easy but I'm new. I want to create a validation for a Detection Method on SCCM so if this software is listed on programs and features AND version is equal or greater than, so it is installed. But not sure how to use -filter with an two conditionals.

if(Get-WmiObject -Namespace root\cimv2\sms -class SMS_InstalledSoftware -Filter "ARPDisplayName LIKE '%Microsoft Visual C++ 2010%'" AND "ARPDisplayVersion >= '%10.0.40219%'"){return $true}

Any idea??

July 13, 2016 at 1:55 am

That should work as long as it is a valid query. I just saw two minor things.
1- I did not see a ARPDisplayVersion on my system but there was a ProductVersion
2- You were using an invalid WQL operator for Greater than or equal to
Try this

Get-WmiObject -Namespace root\cimv2\sms -class SMS_InstalledSoftware -Filter "ARPDisplayName LIKE '%Microsoft Visual C++ 2010%' and ProductVersion >= '%10.0.40219%'"