Hyper-V Import/Export VM bulk group —
Import bulk :
$dir = dir C:\DIR | ?{$_.PSISContainer}
foreach ($d in $dir){
$path = Join-Path -Path $d.FullName -ChildPath "Virtual Machines\"
$fileBaseNames = (Get-ChildItem $path*.vmcx).Name
$fullpath = $path+$fileBaseNames
& echo $path
& Import-VM -Path $fullpath -Copy
}
Export ALL VM
Get-VM | Export-VM -Path "c:\EXPORT_PATH"
Export particular VM
Export-VM -Name "VM_NAME" -Path "c:\EXPORT_PATH"
If some errors occurred check that Virtual Network Name is the same as precedent!
Categorised as: Windows
Comments are disabled on this post