Skip to content

Instantly share code, notes, and snippets.

@ploegert
Last active September 16, 2015 19:16
Show Gist options
  • Select an option

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

Select an option

Save ploegert/e1e1a8e66b03c7f9c6d0 to your computer and use it in GitHub Desktop.
Get azure VM Images ASM identifies the source image used to create a VM by the name of the VHD containing the image. ARM supports a new way to identify the source image for a VM, based on: Publisher name SKU Version ARM supports the following cmdlets for source images: src: http://blogs.msdn.com/b/cloud_solution_architect/archive/2015/05/05/crea…
<#
ASM identifies the source image used to create a VM by the name of the VHD containing the image. ARM supports a new way to identify the source image for a VM, based on:
Publisher name
SKU
Version
ARM supports the following cmdlets for source images:
#>
Save-AzureVMImage – save a custom image
Get-AzureVMImageSku – get the SKUs for a publisher and offer
Get-AzureVMImagePublisher – get the available publishers
Get-AzureVMImageOffer – get the avalailable ffers from a publisher
Get-AzureVMImageDetail – get the image details for a specific SKU
Get-AzureVMImage – get the image for a specific SKU
The following ARM cmdlet get the details for a specific Windows Server source image:
Get-AzureVMImageDetail -Location "West US" `
-PublisherName "MicrosoftWindowsServer" `
-Offer "WindowsServer"-Skus "2012-R2-Datacenter" -Version "4.0.201504"
$loc = "East US 2"
#Find all the available publishers
Get-AzureVMImagePublisher -Location $loc | Select PublisherName
#Pick a publisher
$pubName="MicrosoftWindowsServer"
$pubName="MicrosoftSQLServer"
Get-AzureVMImageOffer -Location $loc -Publisher $pubName | Select Offer
#Pick a specific offer
$offerName="WindowsServer"
$offerName="SQL2012SP2-WS2012R2"
#View the different SKUs
Get-AzureVMImageSku -Location $loc -Publisher $pubName -Offer $offerName | Select Skus
#View the versions of a SKU
Get-AzureVMImage -Location $loc -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter'
#View detail of a specific version of the SKU
Get-AzureVMImageDetail -Location 'East US' -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus '2012-R2-Datacenter' -Version '4.0.201504'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment