powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-Task



NAME
Get-Task

SYNOPSIS
Retrieves the tasks on a vSphere server.

SYNTAX
Get-Task [[-Status] ] [-Server ] []


DESCRIPTION
Retrieves the tasks on a vSphere server. The cmdlet retrieves information about the current or recent tasks. Use th
e -Status parameter to filter tasks by their current status. To specify a server different from the default one, us
e the -Server parameter.


PARAMETERS
-Status
Specify 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.

Required? false
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Task


NOTES




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

C:\PS>$serv = Connect-VIServer -Server 10.23.112.235

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

$task


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






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-Task.html
Stop-Task
Wait-Task