## PowerCLI Reference

# Wait-Task

## Synopsis

This cmdlet waits for the completion of the specified tasks.

Syntax

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

Related Commands

Online version
Get-Task
Stop-Task

Detailed 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 parameter

Notes

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.

Copyright © VMware, Inc. All rights reserved.