Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 232631

Re: Remove-VM -DeletePermanently leaves files behind

$
0
0

Same result.  Here's my current code:

 

  try
  {
   Stop-VM  -VM $vmName -Confirm:$false
   while ($vmName.PowerState -eq "PoweredOn") {start-sleep -seconds 3}
  }
  catch [Exception]
  {
   $m += "Error stopping the VM: " + $_ + "`r`n"
   logError $m
   continue
  }
 

  $m += "Removing " + $vmName + "`r`n"
  try
  {
   Remove-VM -VM $vmName -DeletePermanently -Confirm:$false
  }
  catch [Exception]
  {
   $m += "Error removing the VM: " + $_ + "`r`n"
   logError $m
   continue
  }


Viewing all articles
Browse latest Browse all 232631

Trending Articles



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