PowerTip: Import a Hyper-V Virtual Machine with Only Its .xml File

Summary: Use the new Import-VM cmdlet to import a virtual machine with only its .xml file.

Hey, Scripting Guy! Question I copied a virtual machine to my Hyper-V Server 2012 R2 box and re-created a virtual network with the same name. How can I use Windows PowerShell to import it with without using RSAT?

Hey, Scripting Guy! Answer Use the Import-VM cmdlet in Windows Server 2012 and Windows Server 2012 R2,
          and target the .xml file for import (presuming the file structure has not changed):

IMPORT-VM -Path ‘C:\ContosoVM1\Virtual Machines\2E5DDCDA-8DCC-4FFC-ABEE-49DAB70C8774.xml’