![]() ![]() To check on them, just enter the variable's name at the prompt to display its value, which, if you typed correctly, should be the hash table. $NFLMascots = "Panther" "New England" = "Patriot" "Seattle" = "Seahawk" "Dallas" = "Cowboy" "Atlanta" = "Falcon"}Įnter those into your PowerShell window to get a feel for how they work. $StateCapitals = Carolina" = "Raleigh" "California" = "Sacramento" "New York" = "Albany" "Florida" = "Tallahassee" "Texas" = "Austin"} Let's use both of the above "spelled-out" tables as examples. ![]() You can start off a hash table as the value of a variable, and then you simply place an sign, a left curly brace, and then use '"key1" = "value1" "key2 = "value2"' and so on. ![]() These pairs store a single piece of data the key is the descriptive word about the data and the value is the actual piece of data.Īgain, in a table for professional football team mascots, the key would describe the team and the value would describe the actual mascot, the thing that is in question.Ī hash table is actually just a table full of those key value pairs. Hash tables are a fancy way of saying "A table full of single pieces of information many times over." Those single pieces of information are known as name-value pairs, or key-value pairs as you might sometimes see them called. I'm going to try to simplify things as much as possible. It just takes a while to both (a) understand them and their use fully and (b) wrap your head around the extremely funky syntax that they use. These are very useful tools to have in your arsenal. I'm going to get abstract with you here but, as far as I know, there is no way around it. Let me warn you in advance, however: Put on your advanced thinking caps for this piece, especially if you are a non-programmer or non-developer and are used to pointing at things and clicking them once or twice to accomplish some tasks. In this next installment of my ongoing PowerShell series, I want to focus on putting PowerShell objects to work for you. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |