Thanks for quick response , i need it in below format. I ran the above script but in that i am not getting the used and free space details.pls help i can get the details in below format. Thanks
VMName, Allocated DiskSize, UsedDisk Size, Free Space, Disk Format, DataStore Name
VM1 100 GB 50GB 50 GB Thick Datastore1