I am starting to deep into powershell scripting, I have one task that is to get some stats of incoming and outgoing mails, this is not the problem, I manage to have the list in a result variable, but I need to group it and measure it by two properties in a hierarchical way.
You can use Group-Object cmelet. You will do it against both the properties (Route and To). Can you attempt with this hint and let us know here if you face any difficulties.
The only way to really group this visually is with `Format-Table`, but this won’t get you a usable structured object to further process, so mind that you only do the formatting action when necessary, and retain the data as properly structured objects in a variable before that point, if you need to do any number crunching.