Categories
Windows

From AzureRM to AZ

The Az PowerShell module has been for a while the recommended PowerShell module for interacting with Azure. Here is the quick guide how to install AZ on Windows 10.

Powershell script to un-install Azure/AzureRM and install AZ

# Remove base modules:
uninstall-module Azure
uninstall-module AzureRM

# Remove the rest
$Modules = Get-Module -ListAvailable | Where {$_.Name -like 'AzureRM.*'}
Foreach ($Module in $Modules) {Uninstall-Module $Module}

# Install AZ
if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM -ListAvailable)) {
    Write-Warning -Message ('Az module not installed. Having both the AzureRM and ' +
      'Az modules installed at the same time is not supported.')
} else {
    Install-Module -Name Az -AllowClobber -Scope AllUsers -Force
}


# Connect to Azure with a browser sign in token
Connect-AzAccount

Further reading

Build your skills with Microsoft Learn

Other Azure PowerShell modules