Skip to content

Instantly share code, notes, and snippets.

@vtrifonov-esfiddle
Last active April 13, 2020 22:56
Show Gist options
  • Save vtrifonov-esfiddle/abad527c1c0b28512c535f7f3ceeeb94 to your computer and use it in GitHub Desktop.
Save vtrifonov-esfiddle/abad527c1c0b28512c535f7f3ceeeb94 to your computer and use it in GitHub Desktop.
Import VM in Hyper-V
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