Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Update Azure Powershell module with Powershell
# Get latest azure-powershell
$AzureModule = Get-Module -Name Azure* -ListAvailable
$LatestRelease = Invoke-RestMethod -Uri -Method GET
If (-not($AzureModule) -or $AzureModule.Version.ToString() -ne $
$Asset = $LatestRelease.assets | Where-Object {$ -like "*.msi"}
$OutFile = "{0}\{1}" -f $env:TEMP, $
Invoke-WebRequest -Uri $Asset.browser_download_url -OutFile $Outfile -Method Get
Start-Process -FilePath msiexec.exe -ArgumentList @("/i $OutFile /qb") -Wait -PassThru
Write-Host "Azure Powershell module is up to date."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.