Skip to content

Instantly share code, notes, and snippets.

@ajomathew
Created June 5, 2021 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajomathew/d4ee44268cc7818a006a18f9fb6767c3 to your computer and use it in GitHub Desktop.
Save ajomathew/d4ee44268cc7818a006a18f9fb6767c3 to your computer and use it in GitHub Desktop.
This script can be used to find the VM Source Image available SKU in Azure
# Finding your SKUs for your VM
$locName = Read-Host 'Enter which location you want'
#List Publishers
# $locName="<Azure location, such as West US>"
Get-AzVMImagePublisher -Location $locName | Select PublisherName
$pubName=Read-Host 'Enter publisher your want'
Get-AzVMImageOffer -Location $locName -PublisherName $pubName | Select Offer
$offerName=Read-Host 'Enter the offer'
Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | Select Skus
$skuName=Read-Host 'Enter SKU'
Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Sku $skuName | Select Version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment