What's new with hash tables in PowerShell 3.0 is they can
be[Ordered]. With just one command you can sequence values thus: [Ordered]@{"Key1" = "Value 1";"Key2" =
"Value 2; etc ..."}.
Arrays are useful, but only if you have a series of single values.
Hash tables extend arrays by allowing you to have data in the format of
Key = Value.
Name Value --------- ----- England Rose Ireland
Shamrock Scotland Thistle Wales Daffodil
Guy Recommends: SolarWinds' Free Bulk Import Tool
Import users from a spreadsheet. Just provide a list of the
users with their fields in the
top row, and save as .csv file. Then launch this FREE utility and match
your fields with AD's
attributes, click to import the users. Optionally, you can
provide the name of the OU where the new accounts will be born.
There are also two bonus tools in this free download, and all 3 have been approved by Microsoft:
Hashtables are sometimes called dictionaries; whatever the name, and
whatever the spelling, you can list the full set of methods and properties by
appending | Get-Member.
One benefit of creating a hash table is that you can add data, for
example:
$Countries.Add("France", "Cockrell")
Note 4: The .Add method requires (Parenthesis) not
{curly} brackets.
Footnote: This research solves the mystery of why
PowerShell doesn't have a .Delete method; the reason is because it
consistently uses .Remove for this task.
Another new feature in version 3.0 is [Ordered] hash tables.
Thanks to this one word [ordered] you can achieve a quicker and better
solution for sequencing values than was possible in PowerShell v 2.0.
If you like this page then please share it with your friends
Windows Management Instrumentation (WMI) is one of the hidden
treasures of Microsoft operating systems.
Fortunately, SolarWinds
have created the
Free WMI Monitor so that you can actually see and understand these gems of
performance information. Take the guess work out of which
WMI counters to use for applications like Microsoft Active Directory,
SQL or Exchange Server.