Summary
In this chapter, we explored the creation of and interaction with variables in PowerShell, a fundamental part of any scripting language.
Variables can be used in strings to create dynamic content in code. The use of provider-specific variables in strings was explored.
Variable commands can be used to interact with variables beyond changing the value, such as setting a description, making a variable in a specific scope, or exploring the facets of a variable.
Variable scope was explored, and scope modifiers were introduced, which can affect the scope in which a variable is set.
Arrays and more advanced collections were introduced as a means of storing large sets of data. The idea of assigning statements instead of explicitly building arrays was introduced as the simplest and most performance-friendly approach.
Finally, hashtables and ordered dictionaries were explored. Hashtables are very widely used in PowerShell for multiple purposes and can be used as...