Skip to content

Instantly share code, notes, and snippets.

@ploegert
Created June 9, 2015 15:21
Show Gist options
  • Select an option

  • Save ploegert/722c5abd9fa2cda49ff1 to your computer and use it in GitHub Desktop.

Select an option

Save ploegert/722c5abd9fa2cda49ff1 to your computer and use it in GitHub Desktop.
Get the latest Azure Powershell Versions
function Get-WindowsAzurePowerShellVersion
{
[CmdletBinding()]
Param ()
## - CHECK INSTALLED VERSION
Write-Host "`r`nInstalled version: " -ForegroundColor 'Yellow';
import-module azure
(Get-Module -name "Azure" | Where-Object{ $_.Name -eq 'Azure' }) | Select Version, Name, Author | Format-List;
## - CHECK WEB PI FOR AVAILABLE VERSION
Write-Host "Available version: " -ForegroundColor 'Green';
[reflection.assembly]::LoadWithPartialName("Microsoft.Web.PlatformInstaller") | Out-Null;
$ProductManager = New-Object Microsoft.Web.PlatformInstaller.ProductManager;
$ProductManager.Load(); $ProductManager.Products | Where-object {
($_.Title -like "Microsoft Azure Powershell*") -and ($_.Author -eq 'Microsoft Corporation')
} | Select-Object Version, Title, Published, Author | Format-List;
};
Get-WindowsAzurePowerShellVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment