An Engineers Notebook

PowerShell | Hash Tables

To input a hash table, the command starts with @ and is encased in {}


We can populate whatever Keys and Values we need like this:

@{'Key'='Value';'associate this'='with that';'word'='definition'}

If we place this into a variable, then print the variable we can see how PowerShell stores the data.

We can now call these valles like this:

$ht.key  will produce  “value”

$ht.word  will produce “definition”


Leave a Reply

Your email address will not be published.