How to Delete a Hyper-V VM and ITS Hard Drives

Written by James McDonald

June 8, 2024

If its a replica Remove Replication

Get the paths to the Hard Drives

Get-VM TGN-RWD-BK01 |Select-Object -ExpandProperty HardDrives

Make a note of the location of the hard drives from the output

VMName         ControllerType ControllerNumber ControllerLocation DiskNumber Path
------         -------------- ---------------- ------------------ ---------- ----
TGN-RWD-BK01 IDE            0                0                             D:\Virtual Machines\Hyper-V Replica\Virtual hard disks\32FF1CEC-AGB2-4153-82F8-9BB1A56A70ED\FB8F64AE-24BC-4257-B79C-2C1F8192FB8F.vhdx
TGN-RWD-BK01 SCSI           0                0                             D:\Virtual Machines\Hyper-V Replica\Virtual hard disks\32FF1CEC-AGB2-4153-82F8-9BB1A56A70ED\9FDE8146-E6AE-40C0-A7AA-5D80AAEC7F15.vhdx

Then with GUI or Powershell Remove the VM

Remove-VM TGN-RWD-BK01

In Windows Explorer find and delete the folder containing the vhd’s “D:\Virtual Machines\Hyper-V Replica\Virtual hard disks\32FF1CEC-AGB2-4153-82F8-9BB1A56A70ED\”


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

List local disks

GET-CimInstance -query "SELECT * from Win32_DiskDrive" DeviceID Caption Partitions Size Model -------- -------...

Create ISO using Powershell

Usage New-IsoFile -NewIsoFilePath C:\tmp\Hyper-V.iso-sources -ImageName Hyper-V -SourceFilePath 'C:\tmp\Hyper-V'...