Here is a quick script to create a new resource group, Storage account, storage account container and upload a VHD

 

Switch-AzureMode AzureResourceManager

$ResourceGroupNames = @('RG0','RG1')

foreach($ResourceGroupName in $ResourceGroupNames)
{
$location = 'North Central US'
$StorageAccountName = "sa01"
$StorageType = 'Standard_LRS'
$storageContainer = 'VHDImages'
$StorageAccountName = $StorageAccountName.ToLower()
$storageContainer = $storageContainer.tolower()
New-AzureResourceGroup -Name $ResourceGroupName -Location $location
New-AzureStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName -Type $StorageType -Location $location
$storageKey = Get-AzureStorageAccountKey -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName
$StorageContext = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $storageKey.Key1
New-AzureStorageContainer -Context $StorageContext -Name $storageContainer -Permission Off
Add-AzureVhd -LocalFilePath C:\Users\rplank\Downloads\rhel6-x64-template-azure.vhd -Destination "https://$StorageAccountName.blob.core.windows.net/vhdimages/rhel6-x64-template-azure.vhd" -ResourceGroupName $ResourceGroupName
}

 

Here is a quick script to use to upload Modules to Azure Automation.

Switch-AzureMode AzureResourceManager
$cred = Get-Credential 
Add-AzureAccount -Credential $cred

Select-AzureSubscription -SubscriptionId <SubscriptionID>
$ResourceGroup = Get-AzureResourceGroup -Name "IaaSAutomation"
$MyAutomationAccount = $ResourceGroup | Get-AzureAutomationAccount -Name "IaaSAutomation"
$MyAutomationAccount | New-AzureAutomationModule -name "xWebAdministration"  -ContentLink "https://github.com/PowerShell/xWebAdministration/archive/1.7.0.0-PSGallery.zip" 
$MyAutomationAccount | New-AzureAutomationModule -name "xPhp"  -ContentLink "https://github.com/PowerShell/xPhp/archive/1.1.0.0-PSGallery.zip" 
$MyAutomationAccount | New-AzureAutomationModule -name "xWordPress"  -ContentLink "https://github.com/PowerShell/xWordPress/archive/1.1.0.0-PSGallery.zip" 
$MyAutomationAccount | New-AzureAutomationModule -name "xMySQL"  -ContentLink "https://github.com/PowerShell/xMySql/archive/1.1.0.0-PSGallery.zip"