Use a variable outside the VM's foreach loop, and move the Out-Gridview over there.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Change the last line in your function
to
$out
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Btw, I see what you are trying to do, but let me repeat for the Xth time, there is no fool-proof method to map VMDK to Windows guest OS partitions/drives.
You script/function returned 'FAILED TO MATCH' for most of my VMs.
With PowerCLI 12.0, and provided you meet all of the prerequisites, you can use the Get-VMGuestDisk cmdlet for this kind of mapping.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
I am seeing individual Out-gridview for each VM, Is there a way to get consolidated gridview ?
Use a variable outside the VM's foreach loop, and move the Out-Gridview over there.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That worked perfectly.....Thank you very much LucD,