Thanks, I tried but can't come around the following error:
ForEach-Object : Cannot bind parameter 'Process'. Cannot convert the "@{VM=MyVM}" value of type "System.Management.Automation.PSCustomObject" to type "System.Management.Automation.ScriptBlock".
At C:\MyScript.ps1:6 char:48
+ $_.Group | Group-Object -Property Instance | % <<<< {
+ CategoryInfo : InvalidArgument: (:) [ForEach-Object], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.ForEachObjectCommand