I need to run an automated script which will export the information about cluster, hosts, vms and data stores into Excel/CSV
What Id like is something like
Set path to save document to required location
Create Excel workbook with todays date
Create Hosts Information worksheet
Create Datastore Information worksheet
Create VM Information worksheet
For each cluster in clusters$
For each host in hosts$
Add hosts information to Hosts worksheet including (name, version, cpus, cores, memory, cluster)
Add datastore data to Datastore information worksheet (name, type, total size GB, freespace GB, freespace %)
For each VM in vm$
Add VM data to VM Information worksheet (name, cpu, memory, power, description, tools ver, cluster)
Save all info to excel.
Sorry how rough this is but am very flaky on dev/scripting knowledge. I hope someone can assist or has a script already produced.