Use-SCDiscardSavedStateVM

Changes a virtual machine from the Saved state to the Stopped state.

Syntax

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

Description

The Use-SCDiscardSavedStateVM cmdlet discards the Saved state of a virtual machine in the Saved state. This cmdlet changes the virtual machine from the Saved state to the Stopped state.

Examples

Example 1: Move a virtual machine from Saved state to Stopped state

PS C:\> $Vm01 = Get-SCVirtualmachine -Name "VM01" 
PS C:\> Use-SCDiscardSavedStateVM -VM $Vm01

The first command gets the virtual machine named VM01 by using the Get-SCVirtualMachine cmdlet. The virtual machine is in a saved state. The command stores the virtual machine it in the $Vm01 variable.

The second command moves the virtual machine in $Vm01 to a stopped state.

Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
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
Position:Named
Default value:None
Required:False
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
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VM

Specifies a virtual machine object.

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