Joseph Michael Pesch
VP Programming

Configuring and Running Azure Powershell (for Azure Classic and Azure Resource Manager) on Windows Using Nuget

by 22. August 2016 07:57

Run Windows Powershell ISE as Administrator:
PS > Set-ExecutionPolicy RemoteSigned
PS > Import-Module PowerShellGet
PS > Install-Module Azure (Classic)
PS > Install-Module AzureRM (Resource Manager)

# To make sure the Azure PowerShell module is available after you install
Get-Module –ListAvailable 

# To login to Azure Resource Manager
Login-AzureRmAccount

# You can also use a specific Tenant if you would like a faster login experience
# Login-AzureRmAccount -TenantId xxxx

# To view all subscriptions for your account
Get-AzureRmSubscription

# To select a default subscription for your current session
Get-AzureRmSubscription –SubscriptionName “your sub” | Select-AzureRmSubscription

# View your current Azure PowerShell session context
# This session state is only applicable to the current session and will not affect other sessions
Get-AzureRmContext

# To select the default storage context for your current session
Set-AzureRmCurrentStorageAccount –ResourceGroupName “your resource group” –StorageAccountName “your storage account name”

# View your current Azure PowerShell session context
# Note: the CurrentStorageAccount is now set in your session context
Get-AzureRmContext

# To list all of the blobs in all of your containers in all of your accounts
Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob

Tags:

Azure

Comments are closed