Get-AzVMSize

Retrieve information about virtual machine sizes that are available for a virtual machine in Azure.

SYNOPSIS

Retrieves available virtual machine sizes for a virtual machine.

SYNTAX

Get-AzVMSize
   [-ResourceGroupName ]
   [-VMName ]
   [-Location ]
   [-DefaultProfile ]
   []
Get-AzVMSize
   [-Location ]
   [-DefaultProfile ]
   []

DESCRIPTION

The Get-AzVMSize cmdlet retrieves a list of all virtual machine sizes that are available for a virtual machine. You can specify the location or the resource group and virtual machine name to retrieve the sizes that are available for a specific virtual machine.

PARAMETERS

Name Type Description
-ResourceGroupName String Specifies the name of the resource group for the virtual machine.
-VMName String Specifies the name of the virtual machine.
-Location String Specifies the Azure region where the virtual machine is located.
-DefaultProfile IAzureContextContainer The credentials, account, tenant, and subscription that are used for communication with Azure.

EXAMPLES

# Retrieve all VM sizes available in the East US region
Get-AzVMSize -Location "East US"

# Retrieve VM sizes for a specific virtual machine
Get-AzVMSize -ResourceGroupName "MyResourceGroup" -VMName "MyVM"

# Retrieve VM sizes for a specific VM in a specific location
Get-AzVMSize -Location "West Europe" -VMName "AnotherVM" -ResourceGroupName "AnotherResourceGroup"

INPUTS

System.String

OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachineSizeProperties[]

NOTES

This cmdlet is useful for determining which VM sizes are available in a particular region or for a specific virtual machine, allowing you to make informed decisions about your deployment.