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
# Ref: http://manesh.me/2015/02/05/getting-started-with-microsoft-azure-powershell/ | |
# Step 0: Define all variable values | |
$publishSettingsFile = "C:\Users\Manesh\Documents\AzureSubscriptions.publishsettings"; | |
$location = "West US"; | |
$subscriptionName = "Visual Studio Premium with MSDN"; | |
# Sometimes, you might have multiple MSDN subscriptions | |
# If someone else add you as a co-admin on their MSDN subscription etc. | |
# If so, choose the subscription Id option |
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
# Ref: http://manesh.me/2015/02/06/cleaning-up-azure-storage-accounts/ | |
Get-AzureStorageAccount -WarningAction SilentlyContinue | ForEach-Object { | |
$storageAccountName = $_.StorageAccountName | |
$storageAccountKey = (Get-AzureSTorageKey $storageAccountName).Primary | |
$storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey | |
Write-Host "" | |
Write-Host "Storage Account : " $storageAccountName | |
Get-AzureStorageContainer -Context $storageContext | ForEach-Object { | |
$containerName = $_.Name; |