Jan 07 2022 06:53 AM
Hi,
I am working on a script that gets the CanonicalName for a device from a device and splits it up to determine the support region. I cannot figure out how to get multiple tests to work. If $splitCN[1] equals "Acapulco", "Cozumel", "Lazaro Cardenas", "Mexico City", "Pto Progresso", "Veracruz", $SupportRegion should equal Mexico. I have tried several variations but it doesn't work so far. I know this is possible in other languages but I'm not sure on the PowerShell syntax. How do I accomplish this?
"MEXICO.INT" {
switch ($splitCN[1]) {
("Acapulco","Cozumel","Lazaro Cardenas","Mexico City","Pto Progresso","Veracruz") {
$SupportRegion = "Mexico"
break
}
"Mazanillo" {
$SupportRegion = "ZLO"
break
}
"Tuxpan" {
$SupportRegion = "Tuxpan"
break
}
}
}
Jan 07 2022 09:30 AM
SolutionJan 07 2022 05:50 PM
Jan 07 2022 09:30 AM
Solution