Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 193198

BUG?: Remove-HardDisk / Remove-VM [NOT DELETING]

$
0
0

Hi guys,

 

I have 2 issues in one segment of code:

$oldVM=Get-VM-Name$targetVMname

Get-HardDisk-VM$oldVM | Remove-HardDisk-DeletePermanently-Confirm:$false

Remove-VM-VM$oldVM-DeletePermanently:$true-Confirm:$false

 

The problem is that just the VMDK is left behind afterwards in the VM datastore folder. Hence "-DeletePermanently" is not fully effective...

 

Anyone had this problem?  I know the workaround is to go down the path of creating a function where you specify the datastore, the folder and the file name to delete the orphan OS VMDK - but the above code should work!

 

I've even got the code there for deleting the disk first before attempting to delete the whole VM.


Viewing all articles
Browse latest Browse all 193198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>