none
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

Answers

  • Hi,

    you can code like this:

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

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

    Regards,

    Stefan


    More and news about System Center at stillcool.de and sc-orchestartor.eu .

    Tuesday, July 9, 2019 9:03 PM
    Answerer

All replies