Get-AzureRmVMSize

Gets available virtual machine sizes.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

Get-AzureRmVMSize
   [-Location] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmVMSize
   [-ResourceGroupName] <String>
   [-AvailabilitySetName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmVMSize
   [-ResourceGroupName] <String>
   [-VMName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzureRmVMSize cmdlet gets available virtual machine sizes.

Examples

Example 1: Get virtual machine sizes for a location

PS C:\> Get-AzureRmVMSize -Location "Central US"

This command gets the available sizes for virtual machines in the specified location.

Example 2: Get sizes for an availability set

PS C:\> Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -AvailabilitySetName "AvailabilitySet17"

This command gets available sizes for virtual machines that you can deploy in the availability set named AvailabilitySet17.

Example 3: Get sizes for an existing virtual machine

PS C:\> Get-AzureRmVMSize -ResourceGroupName "ResourceGroup03" -VMName "VirtualMachine12"

This command gets available sizes for the existing virtual machine named VirtualMachine12. You can resize this virtual machine to the sizes that this command gets.

Parameters

-AvailabilitySetName

Specifies the name of the Availability Set for which this cmdlet gets the available virtual machine sizes.

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

-DefaultProfile

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

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

-Location

Specifies the location for which this cmdlet gets the available virtual machine sizes.

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

-ResourceGroupName

Specifies the name of the resource group of the virtual machine.

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

-VMName

Specifies the name of the virtual machine that this cmdlet gets the available virtual machine sizes for resizing.

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

Inputs

String

Outputs

PSVirtualMachineSize