{"id":2716,"date":"2013-10-17T11:59:00","date_gmt":"2013-10-17T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2013\/10\/17\/powertip-import-a-hyper-v-virtual-machine-with-only-its-xml-file\/"},"modified":"2013-10-17T11:59:00","modified_gmt":"2013-10-17T11:59:00","slug":"powertip-import-a-hyper-v-virtual-machine-with-only-its-xml-file","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-import-a-hyper-v-virtual-machine-with-only-its-xml-file\/","title":{"rendered":"PowerTip: Import a Hyper-V Virtual Machine with Only Its .xml File"},"content":{"rendered":"<p><strong>Summary<\/strong>: Use the new&nbsp;<strong>Import-VM<\/strong>&nbsp;cmdlet to import a virtual machine with only its .xml file.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\" \/>&nbsp;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?<\/p>\n<p style=\"padding-left: 30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\" \/>&nbsp;Use the&nbsp;<strong>Import-VM<\/strong>&nbsp;cmdlet in Windows Server&nbsp;2012 and Windows Server&nbsp;2012&nbsp;R2, <br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and target the .xml file for import (presuming the file structure has not changed):<\/p>\n<p style=\"padding-left: 90px\">IMPORT-VM -Path &#8216;C:\\ContosoVM1\\Virtual Machines\\2E5DDCDA-8DCC-4FFC-ABEE-49DAB70C8774.xml&#8217;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/7610.Dr.ScriptoForTips.jpg\" alt=\"\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use the new&nbsp;Import-VM&nbsp;cmdlet to import a virtual machine with only its .xml file. &nbsp;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? &nbsp;Use the&nbsp;Import-VM&nbsp;cmdlet in Windows Server&nbsp;2012 and Windows [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[271,356,154,45],"class_list":["post-2716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-hyper-v","tag-powertip","tag-sean-kearney","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Use the new&nbsp;Import-VM&nbsp;cmdlet to import a virtual machine with only its .xml file. &nbsp;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? &nbsp;Use the&nbsp;Import-VM&nbsp;cmdlet in Windows Server&nbsp;2012 and Windows [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/2716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=2716"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/2716\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=2716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=2716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=2716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}