Use-SCShutdownVM

Changes a virtual machine that is in the Running or Paused state to the Stopped state.

Syntax

Use-SCShutdownVM [-VM] <VM> [-JobVariable <String>] [-PROTipID <Guid>] [-RunAsynchronously]
 [<CommonParameters>]

Description

The Use-SCShutdownVM cmdlet shuts down a virtual machine in System Center 2016 Virtual Machine Manager. This cmdlet changes a virtual machine to the stopped state only if the virtual machine is currently in the Running or Paused state.

Examples

Example 1: Move a virtual machine to the Stopped state

PS C:\> $VM01 = Get-SCVirtualmachine -Name "ContosoVM01" 
PS C:\> Use-SCShutdownVM -VM $VM01

The first command gets the virtual machine named ContosoVM01, and then stores it in the $VM01 variable. The virtual machine is in the Running state or the Paused state.

The second command moves the virtual machine in $VM01 the Stopped state.

Parameters

-JobVariable

Specifies a variable in which job progress is tracked and stored.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VM

Specifies a virtual machine object.

Type:VM
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False