Invoke-XenVMAppliance

Last published : Nov 12, 2026
Invokes an operation on a VMAppliance object.

Syntax

Invoke-XenVMAppliance [-VMAppliance] <VM_appliance>
    -XenAction {Start | CleanShutdown | HardShutdown | Shutdown | AssertCanBeRecovered | Recover}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenVMAppliance [-Ref] <XenRef[VM_appliance]>
    -XenAction {Start | CleanShutdown | HardShutdown | Shutdown | AssertCanBeRecovered | Recover}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenVMAppliance [-Uuid] <guid>
    -XenAction {Start | CleanShutdown | HardShutdown | Shutdown | AssertCanBeRecovered | Recover}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenVMAppliance [-Name] <string>
    -XenAction {Start | CleanShutdown | HardShutdown | Shutdown | AssertCanBeRecovered | Recover}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]

Description

Invokes an operation on a VMAppliance object. Use the -XenAction parameter to select which operation to perform.
Start: Start all VMs in the appliance.
CleanShutdown: Perform a clean shutdown of all the VMs in the appliance.
HardShutdown: Perform a hard shutdown of all the VMs in the appliance.
Shutdown: For each VM in the appliance, try to shut it down cleanly. If this fails, perform a hard shutdown of the VM.
AssertCanBeRecovered: Assert whether all SRs required to recover this VM appliance are available.
Recover: Recover the VM appliance.

Parameters

-Async

If set, the operation runs asynchronously and returns a Task object that can be used to track its progress.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False

-BestEffort

If set, the cmdlet continues processing further objects instead of throwing a terminating error when an operation fails for one object.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False

-Confirm

Prompts for confirmation before running the cmdlet.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False
Aliases cf

-Force

Whether the VMs should replace newer versions of themselves. Accepted when -XenAction is Recover.
Attribute Value
Type bool
Required False
Position Named
Accepts pipeline input False

-Name

The name of the VMAppliance to operate on.
Attribute Value
Type string
Required True
Position 0
Accepts pipeline input True (ByPropertyName)
Aliases name_label

-PassThru

If set, the cmdlet returns the affected object. By default the cmdlet does not generate any output.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False

-Paused

Instantiate all VMs belonging to this appliance in paused state if set to true. Accepted when -XenAction is Start.
Attribute Value
Type bool
Required False
Position Named
Accepts pipeline input False

-Ref

The VMAppliance object to operate on, specified by its opaque reference.
Attribute Value
Type XenRef[VM_appliance]
Required True
Position 0
Accepts pipeline input True (ByPropertyName)
Aliases opaque_ref

-SessionOpaqueRef

The session object on which to run the cmdlet. This overrides the default session and lets you target a specific open XenServer connection.
Attribute Value
Type string
Required False
Position Named
Accepts pipeline input False

-SessionTo

The session to which the VM appliance is to be recovered. Accepted when -XenAction is AssertCanBeRecovered, Recover.
Attribute Value
Type XenRef[Session]
Required False
Position Named
Accepts pipeline input False

-Uuid

The UUID of the VMAppliance to operate on.
Attribute Value
Type guid
Required True
Position 0
Accepts pipeline input True (ByPropertyName)

-VMAppliance

The VMAppliance object to operate on.
Attribute Value
Type VM_appliance
Required True
Position 0
Accepts pipeline input True (ByValue)

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.
Attribute Value
Type SwitchParameter
Required False
Position Named
Accepts pipeline input False
Aliases wi

-XenAction

Selects which action to use.
Attribute Value
Type XenVMApplianceAction
Required True
Position Named
Accepts pipeline input False
Accepted values Start, CleanShutdown, HardShutdown, Shutdown, AssertCanBeRecovered, Recover

Inputs

  • VM_appliance
  • XenRef[VM_appliance]
  • guid
  • string

Outputs

  • System.Object

Examples

Example 1: Run the Start operation

PS> Get-XenVMAppliance -Name "Demo VMAppliance" | Invoke-XenVMAppliance -XenAction Start
Invokes the Start operation on a VMAppliance.

Example 2: Run the Start operation by name

PS> Invoke-XenVMAppliance -XenAction Start -Name "Demo VMAppliance"
Invokes the Start operation on a VMAppliance. -Name matches on name\_label, which is not unique, so every match is operated on.

Example 3: Run Start asynchronously

PS> Invoke-XenVMAppliance -Name "Demo VMAppliance" -XenAction Start -Async -PassThru | Wait-XenTask -ShowProgress
Runs the same operation asynchronously and follows the task it returns.