Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Find Value from PowerShell Hash Table

$
0
0

Summary: Look up values from a Windows PowerShell hash table.

Hey, Scripting Guy! Question How can I look up a specific value that is associated with a specific key in a Windows PowerShell hash table?

Hey, Scripting Guy! Answer Use the Item method and supply the key, for example:

$hash = @{

   2 = "Removable disk"

   3="Fixed local disk"

   4="Network disk"

   5 = "Compact disk"}

 

$hash.Item(3)


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>