Use Hashtable with switch case in PowerShell -
i need make decisions in powershell based on values in hashtable. basically need assign users' upn in active directory according attribute, company one, , thought create hashtable containing keys , values this key value company1 @company1.com company2 @company2.com the issue facing don't know how tell powershell use value rather based on company attribute, don't know how cycle/check company attribute against key in hashtable. i've tried use switches $a -match $hashtable or $a -contains $hashtable with little success. i think hashtable need here, of course open suggestion using external files match number of companies need match rather high. while mathias presented proper solution i'd add more explanation. hashtables , switch statements 2 different solutions same problem: transform input value corresponding output. → "foo" b → "bar" c → "baz" ... hashtables simpler (and faster) appr...