Hi everyone!
I'm trying to write a powershell script to remove virtual hard disks from a VM.
I can use Remove-HardDisk to detatch them from the VM, but it appears to leave the VMDK files on the data store. Is there a way to physically delete the disks too?
Thanks,
Greg
Onced removed from the vm you will have to use the datastore browser and remove te file -
If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Onced removed from the vm you will have to use the datastore browser and remove te file -
If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
The latest PowerCLI build has a -DeleteFromDisk switch on the Remove-VM cmdlet.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Excellent - thank you both!