CopyVHDToAnotherStorageAccount(): Added option for destination VHD name.

This commit is contained in:
Shital Savekar 2017-06-29 14:24:32 +05:30
Родитель 065705ff8d
Коммит cc93e26b8a
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -2285,9 +2285,13 @@ Function CreateAllRGDeploymentsWithTempParameters($templateName, $location, $Tem
return $retValue, $deployedGroups, $resourceGroupCount, $DeploymentElapsedTime return $retValue, $deployedGroups, $resourceGroupCount, $DeploymentElapsedTime
} }
Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageContainer,$destinationStorageAccount,$destinationStorageContainer,$vhdName) Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageContainer,$destinationStorageAccount,$destinationStorageContainer,$vhdName,$destVHDName)
{ {
$retValue = $false $retValue = $false
if (!$destVHDName)
{
$destVHDName = $vhdName
}
$GetAzureRmStorageAccount = Get-AzureRmStorageAccount $GetAzureRmStorageAccount = Get-AzureRmStorageAccount
LogMsg "Retrieving $sourceStorageAccount storage account key" LogMsg "Retrieving $sourceStorageAccount storage account key"
@ -2300,7 +2304,7 @@ Function CopyVHDToAnotherStorageAccount ($sourceStorageAccount,$sourceStorageCon
LogMsg "Retrieving $destinationStorageAccount storage account key" LogMsg "Retrieving $destinationStorageAccount storage account key"
$DestAccountKey= (Get-AzureRmStorageAccountKey -ResourceGroupName $(($GetAzureRmStorageAccount | Where {$_.StorageAccountName -eq "$destinationStorageAccount"}).ResourceGroupName) -Name $destinationStorageAccount)[0].Value $DestAccountKey= (Get-AzureRmStorageAccountKey -ResourceGroupName $(($GetAzureRmStorageAccount | Where {$_.StorageAccountName -eq "$destinationStorageAccount"}).ResourceGroupName) -Name $destinationStorageAccount)[0].Value
[string]$DestAccountName = $destinationStorageAccount [string]$DestAccountName = $destinationStorageAccount
[string]$DestBlob = $vhdName [string]$DestBlob = $destVHDName
$DestContainer = $destinationStorageContainer $DestContainer = $destinationStorageContainer
$context = New-AzureStorageContext -StorageAccountName $srcStorageAccount -StorageAccountKey $srcStorageAccountKey $context = New-AzureStorageContext -StorageAccountName $srcStorageAccount -StorageAccountKey $srcStorageAccountKey