Resume-SCVirtualMachine

Resumes paused virtual machines managed by VMM.

Syntax

Resume-SCVirtualMachine
      [-VM] <VM>
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [-OnBehalfOfUser <String>]
      [-OnBehalfOfUserRole <UserRole>]
      [<CommonParameters>]

Description

The Resume-SCVirtualMachine cmdlet resumes one or more paused virtual machines managed by Virtual Machine Manager (VMM). A paused virtual machine is one that has been suspended by using the Suspend-SCVirtualMachine cmdlet. Using this cmdlet to resume a virtual machine returns its object in a Running state. When the virtual machine is running again, the user can resume activity on that virtual machine.

If you run this cmdlet on a virtual machine that is already running, the cmdlet returns an error message indicating that the virtual machine is not in a state on which it can act.

Examples

Example 1: Resume a paused virtual machine

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Resume-SCVirtualMachine -VM $VM

The first command gets the virtual machine object named VM01, and stores that object in the $VM variable.

The second command resumes the virtual machine stored in $VM to a running state and displays information about the object to the user. The virtual machine must be paused for this command to succeed.

Example 2: Resume all paused virtual machines

PS C:\> $VMs = Get-SCVirtualMachine -VMMServer "VMMServer01.Contoso.com" | where {$_.Status -eq "Paused"}
PS C:\> $VMs | Resume-SCVirtualMachine

The first command gets all virtual machine objects from VMMServer01 that are paused, and then stores those objects in the $VMs object array.

The second command passes each object stored in $VMs to the currenct cmdlet, which resumes each virtual machine to a running 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

-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

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

-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
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

Outputs

VirtualMachine

Notes

  • This cmdlet requires a virtual machine object, which can be retrieved by using the Get-SCVirtualMachine cmdlet.