Previous Topic: dpmhv-ShowTemplates (Funclet) Command--Show Templates on a Hyper-V HostNext Topic: dpmhv-showVMFloppy (Funclet) Command--Show the Properties of Floppy Drive


dpmhv-ShowVMDisks (Funclet) Command--Show all Virtual Disks

The dpmhv-ShowVMDisks command displays all virtual disks in a VM on a Hyper-V host server.

This command has the following format:

dpmhv-showVMDisks 
-vm vmname|-vmid vmguid 
-host hostname 
[-retval] 
[-silent] 
[-detail]
-vm vmname

Specifies the name of the VM.

-vmid vmguid

Specifies the unique ID of the VM.

-host hostname

Specifies the name of the Hyper-V server host.

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

-detail

(Optional) Displays the details of the list of virtual disks.

Return Value

The dpmhv-ShowVMDisks command returns an array of objects which represents the disks attached to a VM.

The following properties are returned in regular mode:

The following properties are returned in detail mode:

Example: Show all Virtual Disks of a VM

This example returns the list of virtual disks attached to the VM.

dpmhv-showVMDisks 
-host hvserver 
-vm TestVM

Example: Show all Disks and Virtual Hard Drive Image Files

This example returns the list of disk and virtual hard drive image files attached to the VM.

dd = dpmhv-showVMDisks -host hvserver -vm TestVM -detail -retval -silent
for each(d in dd)
{
  if(d.ResourceSubType=="Microsoft Virtual Hard Disk")
  {
  ? d.Connection
  }
}