Group-Object on an array?

Question:

How to use Group-Object on the first two columns (a, b) and (c, e) of the following array?

Answer:

Group-Object accepts anonymous calculated properties, in place of property names:


It also accepts a ScriptBlock:

As long as the expression can be evaluated to a string:

Source:

Group-Object on an array? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply