When you are scripting, it is important to put consideration into what kind of container you will be using. Sometimes the simplicity of creating a singular variable and updating that variable is less complex than creating an array or hash table to search through. At other times, it may be more efficient to pull the whole dataset and use individual pieces of that data within your script.
Single-line variables can be used for:
Math operations that require calculations of single or multiple values
Catching single-line output from executing a non-PowerShell command
Tracking current position in a loop like "percent complete"
Arrays are best used for:
Storing a list of items for individual processing within a script
Dumping error information from a PowerShell cmdlet
Hashes are best used for: