Query to get program name and version program and Features

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Jonathan Warnken Jonathan Warnken 2 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #46654
    Profile photo of Karen
    Karen
    Participant

    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
    Profile photo of Jonathan Warnken
    Jonathan Warnken
    Participant

    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%'"
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.