PowerCLI Reference



This cmdlet retrieves the tasks on a vCenter Server system.


Get-Task [[-Status] <TaskState>] [-Server <VIConnection[]>] [<CommonParameters>]

Get-Task -Id <String[]> [-Server <VIConnection[]>] [<CommonParameters>]

Related Commands

Online version

Detailed Description

This cmdlet retrieves the tasks on a vCenter Server system. The cmdlet retrieves information about the current or recent tasks. Use the Status parameter to filter tasks by their current status. To specify a server different from the default one, use the Server parameter.


NameTypeDescriptionRequired?Pipeline InputDefault Value
StatusTaskStateSpecifies the status of the tasks you want to retrieve. The valid values are Error, Queued, Running, and Success. Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.falsetrue (ByValue)
IdString[]Specifies the IDs of the tasks that you want to retrieve.

Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
ServerVIConnection[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse

Return Type

Zero or more Task objects



-------------- Example 1 --------------

$serv = Connect-VIServer -Server

$task = Get-Task -Server $serv -Status Error


Retrieves information on all tasks on the server with IP address, whose state is "Error".

Copyright © VMware, Inc. All rights reserved.