Hi,
I am new to vRO. My requirement is to save the VM details (like Name, cpu, RAM etc) to a csv file and save it in shared location.
Please help.
Hi,
Check the scripting classes FileWriter and File - their methods provide a way to create/write files.
As for CSV data to write to file - you'll need to iterate over your VM objects, and for each VM prepare a CSV string which is simple a sequence of VM attribute values, separated by comma characters. For example, if you have VM object in a variable vm, then you can do something like:
var csvLine = vm.name = "," + vm.cpu + "," + vm.memory; // add other VM values as needed
and then write csvLine to the file using FileWriter#writeLine() method.
Thanks for your reply.
How do I save it in shared location like "\\server\Share\vmdetails.csv"