Sureshadmin
Contributor
Contributor

Powercli book function delete-harddisk usage question

From the powercli book functions,  there is function delete-harddisk in chapter 7. How to use this function to delete harddisk (vmdk) files directly from the datastore ie.. A vmdk which is not connected to any of the vm and orphaned in datastore. I have a csv file which has the full path to the vmdk's like [dstore1] abc/abc.vmdk. Want to use this function to delete those vmdk's from datastore. I see reconfigVm_task is used in the function to execute this function with a vm, is there a way to alter the function and enable it to delete the orphaned vmdk directly from datastore

0 Kudos
1 Reply
LucD
Leadership
Leadership

I'm afraid that function can't be easily adapted to handle your request.

But have a look at my Orphaned files and folders – Spring cleaning post.


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

0 Kudos