Variable based if statement in task sequence

MattC3

Member
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
 
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.
 
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.
 
Back
Top