< Back

Wait-Task

Sun Jan 19, 2020 6:47 pm

NAME Wait-Task



SYNOPSIS

This cmdlet waits for the completion of the specified tasks.





SYNTAX

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





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

-Task <Task[]>

Specifies the tasks you want to wait to complete.



Required? true

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

The output of the operation specified by the Task parameter







NOTES









-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... -Task.html

Get-Task

Stop-Task