Using compare values with two or more values RRS feed

  • Question

  • Hi im using the "compare values" activity to check if a value from a ps string is equal to a number like 1234 or 1235

    Can i do this in one activity ?! I tryed to use

    TestID is equal to

    "1234" or "1235"

    dosent work, without " dosent work either.

    If i do only 1234 it works when i have the same value in the string.

    How do i need to code it ?

    • Edited by Deml Tuesday, July 9, 2019 2:21 PM
    Tuesday, July 9, 2019 1:53 PM


  • Hi,

    you can code like this:

    $TestID = "1236"
    $compResult = $TestID -eq "1234" -or $TestID -eq "1235"
    $TestID = "1235"
    $compResult = $TestID -eq "1234" -or $TestID -eq "1235"

    And use it in a "Run .Net Script" Activity like here:



    More and news about System Center at and .

    Tuesday, July 9, 2019 9:03 PM

All replies