Updating Microsoft Azure PowerShell Module

In this blog post, we’ll guide you through the steps to update your Microsoft Azure PowerShell module and provide tips to make the process as seamless as possible.

PowerShell is a powerful automation tool that has become indispensable for managing and maintaining Microsoft Azure cloud resources. To ensure you’re getting the best experience when interacting with Azure through PowerShell, it’s essential to keep your Azure PowerShell module up-to-date.

Check Current Version

Before updating your Azure PowerShell module, it’s essential to know your current version. Run the following command in your PowerShell session.

Get-Module -ListAvailable -Name az  | select Name, Version

Note down the current version and continue to the next step.

Name Version
---- -------
Az   9.4.0

Update

To update the Azure PowerShell module, run the following cmdlet; note that there is no need to use the -force switch unless there is a problem with the current version.

update-Module -Name Az  

After the installation is done, I have two versions installed.

Name Version
---- -------
Az   9.5.0
Az   9.4.0

Remove Old Version

For consistency and better code management, I will go ahead and delete the old version using the following cmdlet.

uninstall-Module az -RequiredVersion 9.4.0

Processing…
Success! You're on the list.

Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.