Previous Topic: dpmhv-destroyTemplate (Cmdlet) Command--Delete a TemplateNext Topic: dpmhv-expandVirtDisk (Funclet) Command--Expand Virtual Disk


dpmhv-destroyVM (Cmdlet) Command--Delete VM

The dpmhv-destroyVM command lets you delete existing VM specifications, virtual disks, floppy images, and its related snapshots.

This command has the following format:

dpmhv-destroyVM 
-host hostname 
-vm vmname|-vmid vmguid 
[-delvhd] 
[-delvfd] 
[-deliso]
[-retval] 
[-silent]
-host hostname

Specifies the name of the Hyper-V server host.

-vm vmname

Specifies the name of the VM.

-vmid vmguid

Specifies the unique ID of the VM.

-delvhd

(Optional) Deletes the virtual hard disk assigned to the VM.

-delvfd

(Optional) Deletes the virtual floppy disk assigned to the VM.

-deliso

(Optional) Deletes the ISO image assigned to the VM.

-retval

Returns a value for further processing.

-silent

Specifies not to direct the output to the screen.

Example: Delete a VM

This example deletes VM with the virtual hard disk and floppy disk attached to the VM.

dpmhv-destroyVM -host hvserver -vm TestVM -delvhd -delvfd