I'm not sure if you want help on Case (switch) statements and/or WMI scripting in Powershell. I'm guessing Case statements, so here is some code adressing that:
$ComputerName = "ABCDE12345"
switch ($ComputerName.Substring(0, 5))
{
"ABCDE" {
Write-Host "Found it!"
}
}