MoRobin
Contributor
Contributor

Merge multiple informations in one excel export

Hello everybody,

i have a problem to get that informations out of the VM host in a way i can export it in a excel file.

I want to write a script that shwos me:

Model of Host

     CPU

     RAM

Storage name and device

     Storage adapters

Detailed ESX version informations

NICs and the NIC speed

     All network adapters

Hyperthreading status

I searched a lot in that forum about how to get that inforamtions from a single host.

And when i type the commands in powercli i get every information from that list.

Thats great!

My problem is that i cant export that information in one excel file.

Sometimes it shows just not the information i need when i export it or it just writes some information in wrong columns because of that fact that in some code i copyed it shows multiple lines and in other ones just one line.

Is it possible to merg that information of one host or (that would be even greater) multiple hosts in one single excel file?

Thanks for your help!

Tags (2)
0 Kudos
2 Replies
LucD
Leadership
Leadership

If you want to use the Export-Csv cmdlet to export the information then you are a bit limited.

The Export-Csv cmdlet takes the first element in the array that you feed it to determine how many columns there will be and what the name of these columns will be.

Your options

1) Create a common line or row that holds all the properties you want in the CSV file

2) export the distinct information to seperate worksheets in the same spreadsheet (XLS). See my Beyond Export-Csv: Export-Xls post


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

0 Kudos
MoRobin
Contributor
Contributor

okay thanks.

i think i need i few days untile i merge my searched code snipes with that code you linked.

Its a bit confusing right now but i hope i will get it working.

Any other suggesstions or code that i can copy is welcome :smileygrin:

0 Kudos