Start-AzVM
Start-AzVirtualMachine
Starts a stopped virtual machine.
SYNOPSIS
Starts a stopped virtual machine.
SYNTAX
Start-AzVM [-ResourceGroupName] <String> [-Name] <String> [-Force] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
Start-AzVM [-VM] <PSVirtualMachine> [-Force] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The Start-AzVM cmdlet starts a stopped virtual machine.
This cmdlet can start a virtual machine by specifying its name and the resource group it belongs to, or by passing a virtual machine object to the cmdlet.
PARAMETERS
| Name | Type | Description |
|---|---|---|
| -ResourceGroupName | [String] | Specifies the name of the resource group for the virtual machine. |
| -Name | [String] | Specifies the name of the virtual machine to start. |
| -VM | [Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine] | Specifies a virtual machine object. You can use the pipeline operator to pass a virtual machine object to this cmdlet. |
| -Force | [Switch] | Forces the command to run without asking for user confirmation. |
| -AsJob | [Switch] | Run cmdlet in the background. |
| -WhatIf | [Switch] | Performs the cmdlet's action but only shows what would happen if the cmdlet ran. |
| -Confirm | [Switch] | Prompts you for confirmation before running the cmdlet. |
EXAMPLES
Example 1: Start a virtual machine
PS C:\> Start-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07"
This command starts the virtual machine named "VirtualMachine07" in the resource group "ResourceGroup11".
Example 2: Start a virtual machine using a VM object
PS C:\> $VM = Get-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07"
PS C:\> Start-AzVM -VM $VM
This command retrieves the virtual machine object for "VirtualMachine07" and then starts it.
Example 3: Start a virtual machine without confirmation
PS C:\> Start-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07" -Force
This command starts the virtual machine named "VirtualMachine07" without prompting for confirmation.