Azure VM image availability via PS

There are situations and scenerios where we need to check weather particular image is available in certain location or not, is certain image available in the market place or not and so many other where we need to dig out Image , Publisher , offer etc etc.

So below is the few cmdlets which can help you figure out image or publisher or version as per your requirement.



$locName="West US"
$pubName="MicrosoftWindowsServer"

Get-AzVMImagePublisher -Location $locName | Select PublisherName

$offerName="WindowsServer"

Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | where { $_.Skus -like '*Smalldisk'}

$skuName="2016-Datacenter-smalldisk"

Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Sku $skuName | Select Version

Get-AzVMImagePublisher -Location $locName | Select PublisherName


$version = "2016.127.20190603"

Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Skus $skuName -Version $version

1 comment:

What is RBAC Baseline in Azure Landing Zone?

  What is RBAC Baseline in Azure Landing Zone? In simple terms, an RBAC baseline is the default set of access roles and assignments...