編集

次の方法で共有


Get-AzVMSize

Gets available virtual machine sizes.

Syntax

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

Description

The Get-AzVMSize cmdlet gets available virtual machine sizes.

Examples

Example 1: Get virtual machine sizes for a location

Get-AzVMSize -Location "Central US"

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

Example 2: Get sizes for an availability set

Get-AzVMSize -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

Get-AzVMSize -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:AzContext, 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