Installing the Azure PowerShell Service Management module
Installing Azure PowerShell from the PowerShell Gallery is the preferred method of installation.
Step 1: Install PowerShellGet
Installing items from the PowerShell Gallery requires the PowerShellGet module. Make sure you have the appropriate version of PowerShellGet and other system requirements. Run the following command to see if you have PowerShellGet installed on your system.
Get-InstalledModule PowerShellGet -AllVersions | Select-Object Name,Version,Path
You should see something similar to the following output:
Name Version Path ---- ------- ---- PowerShellGet 18.104.22.168 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\22.214.171.124\PowerShellGet.psd1
If you do not have PowerShellGet installed, see the How to get PowerShellGet.
Step 2: Install Azure PowerShell
Run the following command from the Windows PowerShell console running as Administrator:
The Azure module is a rollup module for the Azure Resource Manager cmdlets. When you install the AzureRM module, any other Azure modules that have not previously been installed will be downloaded and installed from the PowerShell Gallery.
The Azure Service Management module shares dependencies with the Azure PowerShell Resource
Manager modules. If you have installed the Azure PowerShell Resource Manager modules, you will need
to add the
-AllowClobber parameter to the install command. This allows this existing shared
dependencies to be updated. Without this parameter, installation of the module fails.
Install-Module Azure -AllowClobber
After you install this module, you can import the module by running the following command:
To use the cmdlets
To start working with the Azure Service Management cmdlets, first log on to your Azure account. To log on to your account, run the following command:
After logging into Azure, Azure PowerShell creates a context for the given session. That context contains the Azure PowerShell environment, account, tenant, and subscription that will be used for all cmdlets within that session. Now you are ready to use the modules below.
Azure Service Management cmdlets
Azure PowerShell modules are updated frequently. If you notice that the online cmdlet help includes
cmdlets or parameters that are not in your module, download and install the latest version of the
module. To find the version of your module, type:
For sample scripts that can help you automate some of the common tasks in Azure, see the Windows Azure Script Center.
For general information about installing, learning, using, and customizing Windows PowerShell, see Scripting with Windows PowerShell.
How to get PowerShellGet
|OS Version||Install instructions|
|I have Windows 10 or Windows Server 2016||Built into Windows Management Framework (WMF) 5.0 included in the OS|
|I want to upgrade to PowerShell 5||Install the latest version of WMF|
Checking the version of Azure PowerShell
Although we encourage you to upgrade to the latest version as early as possible, several versions
of Azure PowerShell are support. To determine the version of Azure PowerShell you have installed,
Get-InstalledModule Azure from your command line.
Get-InstalledModule Azure -AllVersions | Select-Object Name,Version,Path