Output Import Information, Improve download speed (#415)
This commit is contained in:
Родитель
af2e143dfa
Коммит
c1d5094997
|
@ -112,6 +112,21 @@ function Sync-AzSOfflineMarketplaceItem {
|
||||||
$intAnswer = $a.popup($productDetails.properties.description, `
|
$intAnswer = $a.popup($productDetails.properties.description, `
|
||||||
0, "Legal Terms", 4)
|
0, "Legal Terms", 4)
|
||||||
If ($intAnswer -eq 6) {
|
If ($intAnswer -eq 6) {
|
||||||
|
|
||||||
|
#Output Parameters required for Import
|
||||||
|
$FileExists = Test-Path "$destination\$azpkgName.txt"
|
||||||
|
$DestinationCheck = Test-Path $destination
|
||||||
|
If ($DestinationCheck -eq $false) {
|
||||||
|
new-item -ItemType Directory -force $destination
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
|
||||||
|
If ($FileExists -eq $true) {Remove-Item "$destination\$azpkgName.txt" -force} else {
|
||||||
|
New-Item "$destination\$azpkgName.txt"
|
||||||
|
}
|
||||||
|
$productDetails.properties|select publisherIdentifier,offer,offerversion,sku |out-file "$destination\$azpkgName.txt" -Append
|
||||||
|
|
||||||
|
|
||||||
# download azpkg
|
# download azpkg
|
||||||
$azpkgsource = $downloadDetails.galleryPackageBlobSasUri
|
$azpkgsource = $downloadDetails.galleryPackageBlobSasUri
|
||||||
$FileExists = Test-Path "$destination\$azpkgName.azpkg"
|
$FileExists = Test-Path "$destination\$azpkgName.azpkg"
|
||||||
|
@ -125,7 +140,9 @@ function Sync-AzSOfflineMarketplaceItem {
|
||||||
New-Item "$destination\$azpkgName.azpkg"
|
New-Item "$destination\$azpkgName.azpkg"
|
||||||
}
|
}
|
||||||
$azpkgdestination = "$destination\$azpkgName.azpkg"
|
$azpkgdestination = "$destination\$azpkgName.azpkg"
|
||||||
Start-BitsTransfer -source $azpkgsource -destination $azpkgdestination -Priority High
|
(New-Object System.Net.WebClient).DownloadFile("$azpkgsource",$azpkgdestination)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch ($downloadDetails.productKind) {
|
switch ($downloadDetails.productKind) {
|
||||||
'virtualMachine' {
|
'virtualMachine' {
|
||||||
|
@ -139,8 +156,7 @@ function Sync-AzSOfflineMarketplaceItem {
|
||||||
New-Item "$destination\$vhdName.vhd"
|
New-Item "$destination\$vhdName.vhd"
|
||||||
}
|
}
|
||||||
$vhdDestination = "$destination\$vhdName.vhd"
|
$vhdDestination = "$destination\$vhdName.vhd"
|
||||||
|
(New-Object System.Net.WebClient).DownloadFile("$vhdsource",$vhddestination)
|
||||||
Start-BitsTransfer -source $vhdSource -destination $vhdDestination -Priority High
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'virtualMachineExtension' {
|
'virtualMachineExtension' {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче