2 Replies Latest reply on Sep 21, 2020 2:06 PM by Vimal348

    Delete Snapshots

    Vimal348 Novice



      We have so many snapshots for multiple VMs that has the snapshot name: 'AAA_SNAPSHOT DDD.CCC.GGG.com 4572373973'.

      But the last part (4572373973) is different for all the VMs.

      Is there a way we can delete those snapshots for all the VMs by selecting only this first part in the below script : 'AAA_SNAPSHOT DDD.CCC.GGG.com'


      I got the below script from LucD for deleting the snapshots.


      $vmlist = Get-Content "C:\VM\Snapshots\vmlists.txt"

      foreach($VM in $VMlist) {

          Get-Snapshot -VM $vm -Name 'Prior to install VM Hardware' |

          Remove-Snapshot -Confirm:$false


      Disconnect-VIServer -Confirm:$false