Let's say I have an array of PSObjects with several properties that are hierarchical. Something like
@{
'city' = 'CityName'
'street' = 'StreetName'
'House' = 'NNN'
'Apartment' = 'MMM'
}
How do I do nested iteration over these properties? Like, city first, then street etc.?
- City A
- Street a
- House 1
- Apartment 1
- Apartment 2
- House 2
- Apartment 1
- Apartment 2
- House 1
- Street b House 1
- Street a
... etc...
What comes to mind either create lists of unique values for each property and then iterate through them filtering corresponding objects, or use multiple Group-Objects?