Overview
[Object[]]
,[Array]
List of values[PSCustomObject]
Custom entity of members and properties[Hashtable]
Dictionary of key-value pairs[Collections.Specialized.OrderedDictionary]
Ordered dictionary of key-value pairs
Create containers
Containers
Array
[Object[]]
,[Array]
List of values
Create an array
Iterate over it
Custom object
[PSCustomObject]
Custom entity of members and properties
Create a custom object
Access its properties
Iterate over it
Dictionary
[Hashtable]
Dictionary of key-value pairs
Create a hashtable
Access its properties
Iterate over it
Ordered dictionary
[Collections.Specialized.OrderedDictionary]
Ordered dictionary of key-value pairs
Create a ordered dictionary
Access its properties
Iterate over it
Sources:
- 2022-12-17: PowerShell Hash Table vs. PSCustomObject- Deep Dive & Comparison - Jeff Brown Tech
- 2023-03-03: dictionary - Looping through a hash, or using an array in PowerShell - Stack Overflow
- 2023-03-23: about Arrays - PowerShell | Microsoft Learn
- 2023-03-23: PowerShell One-Liners: Collections, Hashtables, Arrays and Strings - Simple Talk
Related:
Tags:
PowerShell Objects - Handle, Import, Export, Filter and RegEx query objects