Variable based if statement in task sequence

Discussion in 'Parallels Mac Management for Microsoft SCCM' started by MattC3, Nov 11, 2015.

  1. MattC3

    MattC3 Member

    Messages:
    20
    Hi

    I'm trying to add some country specific task sequence entries based off the OSDComputerName variable.
    I need to use characters 4, 5 and 6 of the variable for this to work and for this process I don't care about any of the other characters in the variable, but no matter what I've tried with _'s, %'s, $'s and *'s, I can't get the if statement to function.
    I'm beginning to suspect this this is related to there not being a 'Like' comparisson available in the if statement.
    Does anyone know if this is even possible?

    Thanks in advance

    Matt
     
  2. Evgeny Smirnov

    Evgeny Smirnov Parallels Developers

    Messages:
    53
    You're right, "If" statement doesn't support "Like" operator.
    I propose to introduce new variable with 3-chars country code (characters 4, 5 and 6 of the OSDComputerName):
    First approach, add variable same way as OSDComputerName.
    Second approach, do it in runtime like described here http://kb.parallels.com/123327 with different command line:
    OSDComputerName=$("$PMM_TS_VARIABLE_UTIL" --get OSDComputerName); "$PMM_TS_VARIABLE_UTIL" --set OSDCountryCode=${OSDComputerName:3:3}
    Then use OSDCountryCode in your conditions in further steps.
     
  3. MattC3

    MattC3 Member

    Messages:
    20
    Thanks Evgeny.
    Do you know if the Like operator will be added to a future release of PMM?
     
  4. Evgeny Smirnov

    Evgeny Smirnov Parallels Developers

    Messages:
    53
    Currently we don't plan to add this feature.
     
  5. MattC3

    MattC3 Member

    Messages:
    20
    Thanks again Evegny.
    Can we request new features here? I think this would be a useful feature to have, rather than having to break out into a shell script.
     
  6. Evgeny Smirnov

    Evgeny Smirnov Parallels Developers

    Messages:
    53
    Thanks MattC3, I've sent your request to responsible person.
     
    MattC3 likes this.

Share This Page