JindiJee, This one should be able to do what you're looking for. Albeit this generates two CSVs since it really is two seperate reports you're looking for. Unless you're trying to print t...
See more...
JindiJee, This one should be able to do what you're looking for. Albeit this generates two CSVs since it really is two seperate reports you're looking for. Unless you're trying to print the Datastore for the VM on the same line as the VM, that would be a bit different. This script builds a hash table which is a nice way of then shoving it into a CSV. You could trim this one up to make it more "one-liner" , but should assist in getting the picture across. Let me know if you get this working or if it doesn't do what you're thinking. The first one builds two Hash tables and slaps them into two CSVs. If you want to see your Datastores seperate from your VMs. The second script will add the datastore to the first hash table and list it with the VM. This one is not setup to handle VMs with disks on more than 1 datastore. That can be done with some tweaking. Guess I was bored... I added the 3rd which will add a line in your CSV for each Datastore associated with a VM... This means your VM can be listed more than once, but it will list each DS. This should give you a good idea on how you can play with exporting to CSVs. I like the hash table setup.