Start-AzVM

Applies to: Azure PowerShell

Cmdlet: Start-AzVM

Synopsis: Starts a virtual machine.

Description: The Start-AzVM cmdlet starts a virtual machine. You can start a virtual machine that has been stopped or deallocated.

SYNTAX

Start-AzVM [-VM] <PSVirtualMachine[]> [-AsJob] [-Force] [-WhatIf] [-Confirm]
Start-AzVM [-VMName] <String> -ResourceGroupName <String> [-AsJob] [-Force] [-WhatIf] [-Confirm]

DESCRIPTION

The Start-AzVM cmdlet starts a virtual machine. You can start a virtual machine that has been stopped or deallocated.

PARAMETERS

Name Type Description
-VM Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine[] Specifies the virtual machine object. You can use the Get-AzVM cmdlet to create this object.
-VMName System.String Specifies the name of the virtual machine.
-ResourceGroupName System.String Specifies the name of the resource group.
-AsJob System.Management.Automation.SwitchParameter Run cmdlet in the background.
-Force System.Management.Automation.SwitchParameter Force the command to run without asking for confirmation.
-WhatIf System.Management.Automation.SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.
-Confirm System.Management.Automation.SwitchParameter Prompts you for confirmation before running the cmdlet.

EXAMPLES

Example 1: Start a virtual machine

This command starts the virtual machine named "VirtualMachine01".

Start-AzVM -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine01"
Example 2: Start a virtual machine from an object

This command gets the virtual machine object and then starts it.

Get-AzVM -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine01" | Start-AzVM
Example 3: Start a virtual machine without confirmation

This command starts the virtual machine named "VirtualMachine02" without prompting for confirmation.

Start-AzVM -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine02" -Force

RELATED LINKS