Get-AzureRmVMImage

Gets all the versions of a VMImage.

Caution

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

Get-AzureRmVMImage
   -Location <String>
   -PublisherName <String>
   -Offer <String>
   -Skus <String>
   [-FilterExpression <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmVMImage
   -Location <String>
   -PublisherName <String>
   -Offer <String>
   -Skus <String>
   -Version <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzureRmVMImage cmdlet gets all the versions of a VMImage.

Examples

Example 1: Get VMImage objects

PS C:\> Get-AzureRmVMImage -Location "Central US" -PublisherName "MicrosoftWindowsServer" -Offer "windowsserver" -Skus "2012-R2-Datacenter"

This command gets all the versions of VMImage that match the specified values.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-FilterExpression

Specifies a filter expression.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Location

Specifies the location of a VMImage.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Offer

Specifies the type of VMImage offer. To obtain an image offer, use the Get-AzureRmVMImageOffer cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-PublisherName

Specifies the publisher of a VMImage. To obtain an image publisher, use the Get-AzureRmVMImagePublisher cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Skus

Specifies a VMImage SKU. To obtain an SKU, use the Get-AzureRmVMImageSku cmdlet.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

-Version

Specifies the version of the VMImage.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Outputs

PSVirtualMachineImage

PSVirtualMachineImageDetail