Add Option to use AzCopy
This commit is contained in:
Родитель
41b56a1008
Коммит
a5a586609c
|
@ -140,9 +140,23 @@ function Sync-AzSOfflineMarketplaceItem {
|
|||
New-Item "$destination\$azpkgName.azpkg"
|
||||
}
|
||||
$azpkgdestination = "$destination\$azpkgName.azpkg"
|
||||
(New-Object System.Net.WebClient).DownloadFile("$azpkgsource",$azpkgdestination)
|
||||
|
||||
|
||||
#Select Premium Download
|
||||
$a = new-object -comobject wscript.shell
|
||||
$intAnswer = $a.popup("Would yuu like to use Premium download? This requires Azure Storage Tools to be installed", `
|
||||
0, "Premium Download", 4)
|
||||
If ($intAnswer -eq 6) {
|
||||
($checktool= test-path 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' )
|
||||
If ($checktool -eq $true){
|
||||
& 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:$azpkgsource /Dest:$azpkgdestination /Y
|
||||
}
|
||||
else{
|
||||
$a.popup("Please install Azure Storage Tools first, canceling")
|
||||
}
|
||||
|
||||
} else {
|
||||
{(New-Object System.Net.WebClient).DownloadFile("$azpkgsource",$azpkgdestination) }
|
||||
}
|
||||
|
||||
switch ($downloadDetails.productKind) {
|
||||
'virtualMachine' {
|
||||
|
@ -156,7 +170,20 @@ function Sync-AzSOfflineMarketplaceItem {
|
|||
New-Item "$destination\$vhdName.vhd"
|
||||
}
|
||||
$vhdDestination = "$destination\$vhdName.vhd"
|
||||
(New-Object System.Net.WebClient).DownloadFile("$vhdsource",$vhddestination)
|
||||
|
||||
#Select Premium Download
|
||||
$a = new-object -comobject wscript.shell
|
||||
$intAnswer = $a.popup("Would yuu like to use Premium download? This requires Azure Storage Tools to be installed", `
|
||||
0, "Premium Download", 4)
|
||||
If ($intAnswer -eq 6) {
|
||||
($checktool= test-path 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' )
|
||||
If ($checktool -eq $true){
|
||||
& 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:$vhdsource /Dest:$vhddestination /Y
|
||||
}
|
||||
else{
|
||||
$a.popup("Please install Azure Storage Tools first,canceling")
|
||||
}
|
||||
}else{(New-Object System.Net.WebClient).DownloadFile("$vhdsource",$vhddestination) }
|
||||
}
|
||||
}
|
||||
'virtualMachineExtension' {
|
||||
|
@ -169,8 +196,19 @@ function Sync-AzSOfflineMarketplaceItem {
|
|||
New-Item "$destination\$zipName.zip"
|
||||
}
|
||||
$zipDestination = "$destination\$zipName.zip"
|
||||
|
||||
Start-BitsTransfer -source $zipsource -destination $zipDestination -Priority High
|
||||
#Select Premium Download
|
||||
$a = new-object -comobject wscript.shell
|
||||
$intAnswer = $a.popup("Would yuu like to use Premium download? This requires Azure Storage Tools to be installed", `
|
||||
0, "Premium Download", 4)
|
||||
If ($intAnswer -eq 6) {
|
||||
($checktool= test-path 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' )
|
||||
If ($checktool -eq $true){
|
||||
& 'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:$zipsource /Dest:$zipdestination /Y
|
||||
}
|
||||
else{
|
||||
$a.popup("Please install Azure Storage Tools first,canceling")
|
||||
}
|
||||
}else{(New-Object System.Net.WebClient).DownloadFile("$zipsource",$zipdestination)}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче