Stop-AzVM

SYNOPSIS

Stops a virtual machine.

SYNTAX

Stop-AzVM
    [-ResourceGroupName] <String>
    [-VMName] <String>
    [-Force]
    [-AsJob]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

DESCRIPTION

The Stop-AzVM cmdlet stops a virtual machine. This cmdlet deallocates the virtual machine, which means that it is not charged for compute usage when it is stopped.

This cmdlet supports the following parameters: Name, ResourceGroupName.

PARAMETERS

Name Type Description
-ResourceGroupName String Specifies the name of the resource group that contains the virtual machine.
-VMName String Specifies the name of the virtual machine to stop.
-Force [Switch] Forces the command to run without asking for user confirmation.
-AsJob [Switch] Run cmdlet in the background.
-WhatIf [Switch] Shows what would happen if the cmdlet runs. The cmdlet is not run.
-Confirm [Switch] Prompts you for confirmation before running the cmdlet.

EXAMPLES

Stop a virtual machine

PS C:\> Stop-AzVM -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine11" -Force

Stop a virtual machine and prompt for confirmation

PS C:\> Stop-AzVM -ResourceGroupName "ResourceGroup11" -VMName "VirtualMachine11"

INPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine

OUTPUTS

Microsoft.Azure.Commands.Compute.Models.PSVirtualMachine

NOTES

To stop a virtual machine and deallocate it, use the -Force parameter.

If you do not deallocate the virtual machine, you will continue to be charged for compute usage.

RELATED LINKS