Last active
April 13, 2020 22:56
-
-
Save vtrifonov-esfiddle/abad527c1c0b28512c535f7f3ceeeb94 to your computer and use it in GitHub Desktop.
Import VM in Hyper-V
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory=$true)] | |
[string] $VmName | |
) | |
$VmBasePath = "$PSScriptRoot\$VmName" | |
$VmFullPath = Get-Childitem -Path $VmBasePath -Recurse -Include *.vmcx | |
Write-Host "VM Path: $VmFullPath" | |
Import-VM -Path $VmFullPath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment