vWorld

vWorld – Oude Doesburgseweg 89C6901 HH Zevenaar – info@vworld.nl – Kantoor: 0316-798037 – Because it’s a virtual world!

Script to update all Azure Powershell Modules

Use this script to update all your Azure Powershell Modules to their latest versions.

Get-Module -Name azure* -ListAvailable |
  Where-Object -Property Name -ne 'AzureRM' |
  ForEach-Object {
    $currentVersion = [Version] $_.Version
    $newVersion = [Version] (Find-Module -Name $_.Name).Version
    if ($newVersion -gt $currentVersion) {
      Write-Host -Object "Updating $_ Module from $currentVersion to $newVersion"
      Update-Module -Name $_.Name -RequiredVersion $newVersion -Force
      Uninstall-Module -Name $_.Name -RequiredVersion $currentVersion -Force
    }
  }