Last active
April 4, 2017 00:34
-
-
Save darrenjrobinson/0b01dc3e7034cf2fcbd90ca00fbb4dc2 to your computer and use it in GitHub Desktop.
Upload VHD to Azure Blob Storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Variables | |
$storageaccount = 'mystorageaccount' | |
$vhdpath = 'c:\users\darrenjrobinson\vhds\WindowsVM.vhd' | |
$BlobName = 'WinXP.vhd' | |
# Login | |
Login-AzureRMAccount | |
Get-AzureRmStorageAccount | select storageaccountname | |
# Get Storage Account | |
$storageContainer = Get-AzureRmStorageAccount | where {$_.StorageAccountName -eq $storageaccount} | Get-AzureStorageContainer | |
# Upload VHD | |
$storageContainer | Set-AzureStorageBlobContent –File $vhdpath –Blob $BlobName -BlobType Page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment