Query to get program name and version program and Features

This topic contains 1 reply, has 2 voices, and was last updated by  Jonathan Warnken 1 year, 10 months ago.

  • Author
  • #46654


    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??

  • #46658

    Jonathan Warnken

    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%'"

You must be logged in to reply to this topic.