Set-​Azure​VM​Size

Sets the size of an Azure virtual machine.

Syntax

Set-AzureVMSize
   [-InstanceSize] <String>
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-Profile <AzureSMProfile>]
   -VM <IPersistentVM>
   [<CommonParameters>]

Description

The Set-AzureVMSize cmdlet updates the size of a virtual machine. It has two parameters: InstanceSize, which is the new size of the virtual machine, and VM, which is a virtual machine object retrieved by using the Get-AzureVM cmdlet. The result of Set-AzureVMSize can be piped to the Update-AzureVM cmdlet or stored in a variable for later use. No actual change is made until Update-AzureVM is executed.

Note: This cmdlet will require the virtual machine to be re-provisioned and it might get a new IP address.

Examples

Example 1: Set the size of a virtual machine

PS C:\> Get-AzureVM -ServiceName "MySvc1" -Name "MyVM3" | Set-AzureVMSize "Small" | Update-AzureVM

This command updates a virtual machine to size "Small".

Required Parameters

-InstanceSize

Specifies the size of the virtual machine.The acceptable values for this parameter are:--ExtraSmall --Small --Medium --Large --ExtraLarge --A5 --A6 --A7

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VM

Specifies the persistent virtual machine object that this cmdlet sets the size of.

Type:IPersistentVM
Aliases:InputObject
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-InformationAction

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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