Azure PowerShell is a set of cmdlets that allow for manging Azure resources directly from the PowerShell command line. Written in .NET Standard, Azure PowerShell works with PowerShell 5.1 on Windows, and PowerShell 6.x and higher on all supported platforms – including Windows, macOS, and Linux.

Starting in December 2018, the Azure PowerShell Az module is in general release and is now the intended PowerShell module for interacting with Azure.

Az is a new module, so the version has been reset to 1.0.0.

Why a new module?

The biggest and most important change is that PowerShell has been a cross-platform product since the introduction of PowerShell Core 6.x, based on the .NET Standard library. Microsoft committed to bringing Azure support to all platforms, which means that the Azure PowerShell modules needed to be updated to use .NET Standard and be compatible with PowerShell Core. Rather than taking the existing AzureRM module and introduce complex changes to add this support, the Az module was created.

Creating a new module also gave Microsoft the opportunity to make the design and naming of cmdlets and modules consistent. All modules now start with the Az. prefix and cmdlets all use the VerbAzNoun form. Previously, cmdlet names were not only longer, there were inconsistencies in cmdlet names.

The number of modules was also reduced: Some modules which worked with the same services have been rolled together, and management plane and data plane cmdlets are now contained all within single modules for their services. For those of you who manually manage dependencies and imports, this makes things much simpler.

How to Uninstall AzureRM module

You need to remove the Azure PowerShell AzureRM module from your system and migrate all code to Az module. Migration steps are here: https://docs.microsoft.com/en-us/powershell/azure/migrate-from-azurerm-to-az

$versions = (Get-InstalledModule AzureRM -AllVersions -ErrorAction SilentlyContinue | Select-Object Version)

$versions | foreach { Uninstall-AllModules -TargetModule AzureRM -Version ($_.Version) -Force }

Download Code Uninstall-AllModules.ps1

How to Install Az module

Requirements

Azure PowerShell works with PowerShell 5.1 or higher on Windows, or PowerShell Core 6.x and later on all platforms. If you aren’t sure if you have PowerShell, or are on macOS or Linux, install the latest version of PowerShell.

 Install-Module -Name Az -AllowClobber -Scope AllUsers 

How to Uninstall Az modules

$modules = (Get-Module -ListAvailable Az.*).Name | Get-Unique
foreach($module in $modules)
{
  Write-Output ("Uninstalling: $module")
  Uninstall-Module $module -Force
}
Uninstall-Module Az -Force -ErrorAction Ignore

Resources