Syntax
Wait-Task [-Task] <Task[]> [<CommonParameters>]Related Commands
Online VersionDetailed Description
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.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Task | Task[] | Specifies the tasks you want to wait to complete. | true | True (ByValue) |
Return Type
The output of the operation specified by the Task parameterNotes
Examples
-------------------------- Example 1 --------------------------
$task = Remove-VM -VM VM -Confirm -RunAsync Wait-Task -Task $task
Waits for the virtual machine to be removed before allowing the next command input.