我使用以下代码从Azure云下载VHD图像。下载速度很慢,所以我想确保这是最好的方法。如果是这样,我可以做任何改进,以便更快地完成下载。
由于
$destinationVHD = "I:\AzureVHD";
$sourceVHDs | foreach-object{
$sourceVHD = [System.Uri]$_;
$destinationVhdPath = (Join-Path -path $destinationVHD -childpath $sourceVHD.Segments[2]);
write-host "`n`rDownloading... ";
write-host $sourceVHD.Segments[2]
Write-Host "Saving to: " $destinationVhdPath;
$duration = Measure-Command{
Save-AzureVhd -Source $sourceVHD.AbsoluteUri -LocalFilePath $destinationVhdPath -NumberOfThreads 10
}
Write-Host "`t Save complete in: " $duration.Hours "hrs," $duration.Minutes "min," $duration "secs," $duration.TotalMilliseconds "millisecs"
}