Using the Remove-SCVirtualMachine PowerShell command in System Center 2012 Virtual Machine Manager may not remove the VM from the Hyper-V host


Symptoms


Using the PowerShell command Remove-SCVirtualMachine with the -force option to delete a virtual machine (VM) in System Center 2012 Virtual Machine Manager (VMM) removes the VM from VMM but may not remove it from the Hyper-V host.

Cause


This is by design.  The PowerShell command Remove-SCVirtualMachine -force is used to remove the VMM object, not the actual virtual machine on the host.

Resolution


If you want to remove the virtual machine from VMM as well as from the host, run the Remove-SCVirtualMachine command without the -force switch.