How to upgrade Azure PowerShell?

I have Azure PowerShell 1.0.3 installed through the Gallery (in the instructions here in the "Installing Azure PowerShell From The Gallery" section). I want to upgrade to the latest version, but I donโ€™t understand which commands I need to run. I tried the following, but decided to ask rather than potentially damage my installation:

PS C:\Windows\system32> Install-Module AzureRM You are installing the module(s) from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install software from 'https://www.powershellgallery.com/api/v2/'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): y WARNING: Version '1.0.3' of module 'AzureRM' is already installed at 'C:\Program Files\WindowsPowerShell\Modules\AzureRM\1.0.3'. To delete version '1.0.3' and install version '1.1.0', run Install-Module, and add the -Force parameter. 

Can someone provide a script for updating Azure PowerShell?

+6
source share
4 answers

The command you must run is in the help text that you published. Use Install-Module -Force AzureRM . See the -Force tag .

Once you update the bootloader, run Install-AzureRM to install the new packages.

Change update (WMF> 4) PowerShell:

PowerShell has an Update-Module AzureRM function that will perform similar activities as Install-Module -Force AzureRM . You can also use the -AllowClobber argument in Install-Module if you have functions already defined in your local environment that AzureRM will overwrite.

However, none of them will update the current environment, so before running Install-AzureRM verify that you have downloaded the latest AzureRM module. For example, if you want to upgrade from 1.0.1 to 1.0.3:

 $ Get-Module AzureRM ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 1.0.1 AzureRM {...} $ Update-Module AzureRM $ # This will still be old because we haven't imported the newer version. $ (Get-Module AzureRM).Version.ToString() 1.0.1 $ Remove-Module AzureRM $ Import-Module AzureRM $ (Get-Module AzureRM).Version.ToString() 1.0.3 $ Install-AzureRM 

Or you can simply open a new PowerShell window after starting the update.

+9
source

It seems that the team has changed a bit, I had to use Install-Module -Force AzureRM -AllowClobber to update it

+5
source

The most reliable way:

Download the latest version of MSI and run it. https://github.com/Azure/azure-powershell/releases

I know that you asked for the script version ... I did not find the answers to the various script satisfactory. (I did not want to install side by side, Install-AzureRM not found, etc.).

0
source

The best and easiest way is from the official link and search highlighted. Link will provide you with MSI latest version of AzurePowershell

enter image description here

-1
source

All Articles