Get-AzVMImage
Gets all the versions of a VMImage.
Syntax
ListVMImage
Get-AzVMImage
-Location <String>
-PublisherName <String>
-Offer <String>
-Skus <String>
[-EdgeZone <String>]
[-Top <Int32>]
[-OrderBy <String>]
[-Expand <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
GetVMImageDetail
Get-AzVMImage
-Location <String>
-PublisherName <String>
-Offer <String>
-Skus <String>
-Version <String>
[-EdgeZone <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzVMImage cmdlet gets all the versions of a VMImage.
Examples
Example 1: List VM Image objects
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter"
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer
26100.2314.241107 centralus MicrosoftWindowsServer
26100.2605.241207 centralus MicrosoftWindowsServer
26100.2894.250113 centralus MicrosoftWindowsServer
26100.3194.250210 centralus MicrosoftWindowsServer
26100.3476.250306 centralus MicrosoftWindowsServer
26100.3775.250406 centralus MicrosoftWindowsServer
This command gets all the versions of VMImage that match the specified values.
Example 2: List VM Image objects with Image Deprecation Status
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Expand properties/imageDeprecationStatus
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2314.241107 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2605.241207 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.2894.250113 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3194.250210 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3476.250306 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
26100.3775.250406 centralus MicrosoftWindowsServer V1 x64 Microsoft.Azure.Management.Compute.Mo…
This command gets all the versions of VMImage that match the specified values with image deprecation statuses.
Example 3: Get VMImage object
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Version 26100.2033.241004
Id : /Subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Providers/Microsoft.Compute/Locations/cent
ralus/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/windowsserver/Skus/2025-d
atacenter/Versions/26100.2033.241004
Location : centralus
PublisherName : MicrosoftWindowsServer
Offer : windowsserver
Skus : 2025-datacenter
Version : 26100.2033.241004
FilterExpression :
Name : 26100.2033.241004
HyperVGeneration : V1
OSDiskImage : {
"operatingSystem": "Windows"
}
PurchasePlan : null
DataDiskImages : []
ImageDeprecationStatus : {
"imageState": "Active",
"scheduledDeprecationTime": null,
"alternativeOption": null
}
This command gets a specific version of VMImage that matches the specified values.
Example 4: Get VMImage objects
Get-AzVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2025-datacenter" -Version 26100.2* -Expand properties
Version Location PublisherName HyperVGeneration Architecture ImageDeprecationStatus
------- -------- ------------- ---------------- ------------ ----------------------
26100.2033.241004 centralus MicrosoftWindowsServer V1 x64
26100.2314.241107 centralus MicrosoftWindowsServer V1 x64
26100.2605.241207 centralus MicrosoftWindowsServer V1 x64
26100.2894.250113 centralus MicrosoftWindowsServer V1 x64
This command gets all the versions of VMImage that match the specified values with filtering over version.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-EdgeZone
Set the extended location name for EdgeZone. If not set, VM Image will be queried from Azure main region. Otherwise it will be queried from the specified extended location
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Expand
The expand expression to apply on the operation. Possible values are: 'properties', and 'properties/imageDeprecationStatus'
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ListVMImage
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Location
Specifies the location of a VMImage.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Offer
Specifies the type of VMImage offer.
To obtain an image offer, use the Get-AzVMImageOffer cmdlet.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-OrderBy
Specifies the order of the results returned. Formatted as an OData query.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ListVMImage
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-PublisherName
Specifies the publisher of a VMImage.
To obtain an image publisher, use the Get-AzVMImagePublisher cmdlet.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Skus
Specifies a VMImage SKU.
To obtain an SKU, use the Get-AzVMImageSku cmdlet.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Top
Specifies the maximum number of virtual machine images returned.
Parameter properties
Type: Nullable<T> [ Int32 ]
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ListVMImage
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-Version
Specifies the version of the VMImage.
Parameter properties
Type: String
Default value: None
Supports wildcards: True
DontShow: False
Parameter sets
GetVMImageDetail
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs