vagrant/plugins/providers/hyperv/scripts/clone_vhd.ps1

19 lines
339 B
PowerShell

#Requires -Modules VagrantMessages
param(
[Parameter(Mandatory=$true)]
[string]$Source,
[Parameter(Mandatory=$true)]
[string]$Destination
)
$ErrorActionPreference = "Stop"
try {
Hyper-V\New-VHD -Path $Destination -ParentPath $Source
} catch {
Write-Error-Message "Failed to clone drive: ${PSItem}"
exit 1
}