Basically I have an array that looks something like
areaCodes = @ (
@("310", "LA"),
@("212", "NY"),
@("702", "LV")
)
I would like to have it so that for example if I have a variable $code = $212 Find if it is in the list, and if is, get the value associated with it.
Something like
if($areaCodes.contains($code))
{
WRITE-HOST $areaCodes[1]
}
and this would output NY
How do I do this in powershell? Or is there are more efficient way to do this?