< Back

Update-AzureVM

Wed Jan 30, 2019 5:56 pm

NAME Update-AzureVM



SYNOPSIS

Modifies the configuration of an Azure virtual machine.





SYNTAX

Update-AzureVM [-ServiceName] <String> [-Name] <String> -VM <PersistentVM> [-Profile <AzureSMProfile>] [-InformationAction <ActionPreference>]

[-InformationVariable <String>] [<CommonParameters>]





DESCRIPTION

The Update-AzureVM cmdlet accepts update information for the specified virtual machine and initiates the update. You can add or remove data disks,

modify the cache mode of data or operating system disks, change the network endpoints, or change the size of the virtual machine.





PARAMETERS

-Name <String>

Specifies the name of the virtual machine to update.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-VM <PersistentVM>

Specifies the virtual machine object that includes updated settings.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue, ByPropertyName)

Accept wildcard characters? false



-ServiceName <String>

Specifies the name of the Azure service.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Profile <AzureSMProfile>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationAction <ActionPreference>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InformationVariable <String>





Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES









-------------------------- Example 1: Update the size of a virtual machine --------------------------



PS C:\\>Get-AzureVM -ServiceName "ContosoService03" -Name "VirtualMachine04" | Set-AzureVMSize -InstanceSize "Medium" | Update-AzureVM



This command changes the size of the virtual machine named VirtualMachine04, running in the service named ContosoService03, to Medium.

-------------------------- Example 2: Add a data disk to a virtual machine --------------------------



PS C:\\>Get-AzureVM -ServiceName "ContosoService03" -Name "VirtualMachine05" | Add-AzureDataDisk -CreateNew -MediaLocation

"https://ContosoStore1.blob.core.azure.c ... Disk22.vhd" -DiskSizeInGB 128 -DiskLabel "Data-128" -LUN 0 | Update-AzureVM



This command adds a new data disk to the virtual machine named VirtualMachine05, running in the service named ContosoService03.



RELATED LINKS

Get-AzureVM

New-AzureVM

New-AzureVMConfig

Remove-AzureVM

Restart-AzureVM

Set-AzureVMSize

Restart-AzureVM

Stop-AzureVM