In order to work in PowerShell with Azure you need to have the modules setup properly, the script below will help get you ready to go then test it.
# Azure PowerShell Get-Module PowerShellGet -list | Select-Object Name,Version,Path # Install the Azure Resource Manager modules from the PowerShell Gallery Install-Module AzureRM -AllowClobber -Force # Install the Azure Service Management module from the PowerShell Gallery Install-Module Azure -AllowClobber -Force
$PSVersionTable $env:PSModulePath # Install the Azure Resource Manager modules from the PowerShell Gallery Install-Module AzureRM # Install the Azure Service Management module from the PowerShell Gallery Install-Module Azure # Import AzureRM modules for the given version manifest in the AzureRM module Import-Module AzureRM # Import Azure Service Management module Import-Module Azure # To make sure the Azure PowerShell module is available after you install Get-Module –ListAvailable # 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 # Add Add-AzureAccount # Show configured Subscriptions Get-AzureSubscription | FT -AutoSize SubscriptionName, SubscriptionID (Get-AzureService).ServiceName get-azurereservedip | Select ReservedIPName, Address, ServiceName
Last Updated on October 16, 2017