Update-AzureVM
Update-AzureVM
Updates the state of an Azure virtual machine.
Syntax
Parameter Set: Default
Update-AzureVM -ResourceGroupName <String> -VM <PSVirtualMachine> [-Name <String> ] [-Profile <AzureProfile> ] [-Tags <System.Collections.Hashtable[]> ] [ <CommonParameters>]
Detailed Description
The Update-AzureVM cmdlet updates the state of an Azure virtual machine to the state of a virtual machine object.
Parameters
-Name<String>
Specifies the name of the virtual machine to update.
Aliases |
ResourceName,VMName |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Profile<AzureProfile>
Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ResourceGroupName<String>
Specifies the name of a resource group.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-Tags<System.Collections.Hashtable[]>
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByPropertyName) |
Accept Wildcard Characters? |
false |
-VM<PSVirtualMachine>
Specifies a local virtual machine object. To obtain a virtual machine object, use the Get-AzureVM cmdlet. This virtual machine object contains the updated state for the virtual machine.
Aliases |
VMProfile |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true(ByValue,ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Update a virtual machine
This command updates the virtual machine named VirtualMachine07 in ResourceGroup11. The command updates it by using another virtual machine object, stored in the $VirtualMachine variable. To obtain a virtual machine object, use the Get-AzureVM cmdlet.
Update-AzureVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -VM $VirtualMachine