VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Unable to get output from multiple VMs

Hi,

I am unable to get the output from multiple VMs. Output file shows blank and out-gridview shows indvidual output.

Please help, how can I get combined output in the xlsx file as well as in out-gridview.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Change the last line in your function

        $results | Out-GridView

to

        $results | Tee-Object -Variable out | Out-GridView

        $out


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

LucD,

I am seeing individual Out-gridview for each VM, Is there a way to get consolidated gridview ?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

That worked perfectly.....Thank you very much LucD, Smiley Happy

0 Kudos