Wait-Task Command | Vmware PowerCLI Reference

Wait-Task

This cmdlet waits for the specified tasks to complete or fail before allowing the next command input. The task progress is observed in real time on the console screen.

Syntax

Wait-Task
-Task < Task[] >
[-ProgressAction < ActionPreference > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Task Task[] named
  • pipeline
Specifies the tasks you want to wait to complete.
optional ProgressAction ActionPreference named

Output

System.Object

Examples

Example 1

Import-Module VMware.VimAutomation.Core

$task = Remove-VM -VM "VM1" -Confirm -RunAsync

Wait-Task -Task $task

Waits for the virtual machine with name "VM1" to be removed before allowing the next command input. This example uses commands from the VMware.VimAutomation.Core module.

Related Commands

Task

This cmdlet retrieves the tasks on the specified VMware Server.

This cmdlet stops the specified tasks.

This cmdlet waits for the completion of the specified tasks.