< Back
Get-Task
Post
NAME Get-Task
SYNOPSIS
This cmdlet retrieves the tasks on the specified VMware Server.
SYNTAX
Get-Task -Id <String[]> [-Server <VIConnection[]>] [<CommonParameters>]
Get-Task [[-Status] <TaskState>] [-Server <VIConnection[]>] [<CommonParameters>]
DESCRIPTION
This cmdlet retrieves the tasks on the specified VMware Server. 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.
PARAMETERS
-Id <String[]>
Specifies the IDs of the tasks that you want to retrieve.
Note: When a list of values is specified for the Id parameter, objects with duplicate Id values are filtered
out from the result list.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIConnection[]>
Specifies the VMware Servers on which you want to run the cmdlet. If no value is given to this parameter, the
command runs on all connected servers.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-Status <TaskState>
Specifies 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 None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more Task objects
NOTES
-------------------------- Example 1 --------------------------
Import-Module VMware.VimAutomation.Core
$server = Connect-VIServer -Server 10.23.112.235
$task = Get-Task -Server $server -Status Error
$task
Retrieves information on all tasks on the server with IP address 10.23.112.235, whose state is "Error". This
example uses commands from the VMware.VimAutomation.Core module.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... -Task.html
Stop-Task
Wait-Task
SYNOPSIS
This cmdlet retrieves the tasks on the specified VMware Server.
SYNTAX
Get-Task -Id <String[]> [-Server <VIConnection[]>] [<CommonParameters>]
Get-Task [[-Status] <TaskState>] [-Server <VIConnection[]>] [<CommonParameters>]
DESCRIPTION
This cmdlet retrieves the tasks on the specified VMware Server. 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.
PARAMETERS
-Id <String[]>
Specifies the IDs of the tasks that you want to retrieve.
Note: When a list of values is specified for the Id parameter, objects with duplicate Id values are filtered
out from the result list.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIConnection[]>
Specifies the VMware Servers on which you want to run the cmdlet. If no value is given to this parameter, the
command runs on all connected servers.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-Status <TaskState>
Specifies 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 None
Accept pipeline input? True (ByValue)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
Zero or more Task objects
NOTES
-------------------------- Example 1 --------------------------
Import-Module VMware.VimAutomation.Core
$server = Connect-VIServer -Server 10.23.112.235
$task = Get-Task -Server $server -Status Error
$task
Retrieves information on all tasks on the server with IP address 10.23.112.235, whose state is "Error". This
example uses commands from the VMware.VimAutomation.Core module.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... -Task.html
Stop-Task
Wait-Task