Invoke-XenCaller

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

Syntax

Invoke-XenCaller [-Caller] <Caller>
    -XenAction {QueryTokenUsage | QueryCallCount | QueryGroupTokenUsage | QueryGroupCallCount | QueryAllUsage}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenCaller [-Ref] <XenRef[Caller]>
    -XenAction {QueryTokenUsage | QueryCallCount | QueryGroupTokenUsage | QueryGroupCallCount | QueryAllUsage}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenCaller [-Uuid] <guid>
    -XenAction {QueryTokenUsage | QueryCallCount | QueryGroupTokenUsage | QueryGroupCallCount | QueryAllUsage}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]
Invoke-XenCaller [-Name] <string>
    -XenAction {QueryTokenUsage | QueryCallCount | QueryGroupTokenUsage | QueryGroupCallCount | QueryAllUsage}
    [-PassThru] [-BestEffort] [-SessionOpaqueRef <string>] [-WhatIf] [-Confirm] [-Async]
    [<CommonParameters>]

Description

Invokes an operation on a Caller object. Use the -XenAction parameter to select which operation to perform.
QueryTokenUsage: Return tokens used by this caller since Xapi startup.
QueryCallCount: Return number of calls made by this caller since Xapi startup.
QueryGroupTokenUsage: Return tokens used since Xapi startup by the callers in the named group.
QueryGroupCallCount: Return number of calls made since Xapi startup by the callers in the named group.
QueryAllUsage: Return per-caller usage for every known caller, sorted by token use descending.

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

-Caller

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

-Confirm

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

-Group

Caller group to aggregate over. Accepted when -XenAction is QueryGroupTokenUsage, QueryGroupCallCount.
Attribute Value
Type string
Required False
Position Named
Accepts pipeline input False

-Name

The name of the Caller 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

-Ref

The Caller object to operate on, specified by its opaque reference.
Attribute Value
Type XenRef[Caller]
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

-Uuid

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

-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 XenCallerAction
Required True
Position Named
Accepts pipeline input False
Accepted values QueryTokenUsage, QueryCallCount, QueryGroupTokenUsage, QueryGroupCallCount, QueryAllUsage

Inputs

  • Caller
  • XenRef[Caller]
  • guid
  • string

Outputs

  • System.Object

Examples

Example 1: Run the QueryTokenUsage operation

PS> Get-XenCaller -Name "Demo Caller" | Invoke-XenCaller -XenAction QueryTokenUsage -PassThru
Invokes the QueryTokenUsage operation on a Caller. -PassThru writes the result to the pipeline.

Example 2: Run the QueryTokenUsage operation by name

PS> Invoke-XenCaller -XenAction QueryTokenUsage -Name "Demo Caller" -PassThru
Invokes the QueryTokenUsage operation on a Caller. -Name matches on name\_label, which is not unique, so every match is operated on. -PassThru writes the result to the pipeline.

Example 3: Run QueryTokenUsage asynchronously

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