PowerTip: Use PowerShell to Search a Hash Table

Doctor Scripto

Summary: Quickly search a hash table in Windows PowerShell.

Hey, Scripting Guy! Question How can I easily search for information in a hash table full of data in Windows PowerShell?

Hey, Scripting Guy! Answer Plug in the name of a value, for example:

[array]$Hashtable=$NULL
$Hashtable+=@{Purple=54}
$Hashtable+=@{People=37}
$Hashtable+=@{Eater=78}

To find the value called People, add the name to the hash table variable:

$Hashtable.People

37

0 comments

Discussion is closed.

Feedback usabilla icon