-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAzure_powershell_CheetsSheet.txt
More file actions
38 lines (27 loc) · 1.47 KB
/
Azure_powershell_CheetsSheet.txt
File metadata and controls
38 lines (27 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# To log in to Azure Resource Manager
Login-AzureRmAccount
# You can also use a specific Tenant if you would like a faster log in experience
# Login-AzureRmAccount -TenantId xxxx
# To view all subscriptions for your account
Get-AzureRmSubscription
# To select a default subscription for your current session.
# This is useful when you have multiple subscriptions.
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
# Install the Azure Resource Manager modules from the PowerShell Gallery
Install-Module AzureRM -Scope CurrentUser
# Install the Azure Service Management module from the PowerShell Gallery
Install-Module Azure -Scope CurrentUser
# To make sure the Azure PowerShell module is available after you install
Get-Module -ListAvailable Azure*
# Enable access from Remote
Set-ExecutionPolicy RemoteSigned