Skip to content

Instantly share code, notes, and snippets.

View Manesh-R's full-sized avatar

Manesh Raveendran Manesh-R

View GitHub Profile
@Manesh-R
Manesh-R / SetAzureEnvironment
Last active September 24, 2015 17:01
PowerShell script to initialize Azure subscription and storage account. http://manesh.me/2015/02/05/getting-started-with-microsoft-azure-powershell/
# 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
@Manesh-R
Manesh-R / GetUnusedStorageAccounts
Last active August 29, 2015 14:14
Microsoft Azure: Find out storage accounts that are good to be deleted - http://manesh.me/2015/02/06/cleaning-up-azure-storage-accounts/
# 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;