Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Stop-AzVM

Stops an Azure virtual machine.

Syntax

ResourceGroupNameParameterSetName (Default)

Stop-AzVM
 [-ResourceGroupName] <String>
 [-Name] <String>
 [-Force]
 [-StayProvisioned]
 [-NoWait]
 [-SkipShutdown]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

ResourceGroupHibernateParameterSet

Stop-AzVM
 [-ResourceGroupName] <String>
 [-Name] <String>
 [-Force]
 [-NoWait]
 [-Hibernate]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

IdParameterSetName

Stop-AzVM
 [-Id] <String>
 [-Force]
 [-StayProvisioned]
 [-NoWait]
 [-SkipShutdown]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

IdHibernateParameterSet

Stop-AzVM
 [-Force]
 [-NoWait]
 [-Hibernate]
 [-AsJob]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf]
 [-Confirm]
 [<CommonParameters>]

Description

The Stop-AzVM cmdlet stops an Azure virtual machine.

Examples

Example 1: Stop a virtual machine

Stop-AzVM -ResourceGroupName "ResourceGroup11" -Name "VirtualMachine07"

This command stops the virtual machine named VirtualMachine07 in ResourceGroup11.

Parameters

-AsJob

Run cmdlet in the background and return a Job to track progress.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Hibernate

Optional parameter to hibernate a virtual machine. (Feature in Preview)

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Id

The ID of the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

The virtual machine name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-NoWait

Starts the operation and returns immediately, before the operation is completed. In order to determine if the operation has successfully been completed, use some other mechanism.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ResourceGroupName

Specifies the name of the resource group of the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-SkipShutdown

To request non-graceful VM shutdown when keeping the VM provisioned.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-StayProvisioned

The cmdlet stops a virtual machine, but does not deallocate it. The account is charged for the stopped virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

PSComputeLongRunningOperation

PSAzureOperationResponse

Related Links


Feedback

Was this page helpful?