Check Virtual Hard Disks for VM

Check Virtual Hard Disks for VM

Q: How can I quickly see all the virtual hard disks (VHDs) attached to a specific Hyper-V virtual machine (VM)?

A: The Windows PowerShell script below shows all the VHDs and whether they're connected via IDE or SCSI controller.

PS C:\> Get-VM savdalfs01 | Get-VMHardDiskDrive 

VMName     ControllerType ControllerNumber ControllerLocation DiskNumber Path                                                          
------     -------------- ---------------- ------------------ ---------- ----                                                          
savdalfs01 IDE            0                0                             E:\virtuals\savdalfs01\Virtual Hard Disks\savdalfs01.vhdx     
savdalfs01 SCSI           0                0                             E:\virtuals\savdalfs01\Virtual Hard Disks\savdalfs01-data.vhdx


Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.