Hello, @Varma !
How do I install Azure PowerShell on Windows? What are alternatives to a local installation?
I quickly want to mention an alternative to a local installation that I find to be very helpful, Azure Cloud Shell. It works from any browser, has up to date modules, and can be a quick and easy way to bypass any issues you may have with a local installation:
https://learn.microsoft.com/en-us/azure/cloud-shell/get-started/classic?tabs=azurecli

If you are installing locally, I second the recommendation from @JimmySalian-2011 and would like to underscore that it is recommended to be used with PowerShell version 7 or higher:
https://learn.microsoft.com/en-us/powershell/azure/install-azps-windows?view=azps-11.2.0&tabs=powershell&pivots=windows-psgallery
If you want to use PowerShell version 5.1, you'll need to meet these prerequisites:
- Confirm your version of PowerShell with
$PSVersionTable.PSVersion
(and I see you have 5.1)
- Determine if you have the AzureRM PowerShell module installed with
Get-Module -Name AzureRM -ListAvailable
(if you have the AzureRM PowerShell module installed, you'll need to reference Az and AzureRM coexistence).
Then you'll need to complete the remaining perquisites:
Update to Windows PowerShell 5.1
Install .NET Framework 4.7.2 or later
- Update PowerShellGet
Launch Windows PowerShell 5.1 elevated as an administrator and run the following command to update PowerShellGet:
Install-Module -Name PowerShellGet -Force
- Set the PowerShell execution policy to remote signed or less restrictive
- Check the PowerShell execution policy:
Get-ExecutionPolicy -List
- Set the PowerShell execution policy to remote signed:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
After the prerequisites have been completed, you can use the Install-Module
cmdlet to install the Az PowerShell module:
Install-Module -Name Az -Repository PSGallery -Force
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!
