Documentation Index
Fetch the complete documentation index at: https://mintlify.com/HewlettPackard/POSH-HPEOneView/llms.txt
Use this file to discover all available pages before exploring further.
Synopsis
Wait for one or more HPE OneView task resources to finish before continuing script execution.Syntax
Description
Wait-OVTaskComplete polls the HPE OneView appliance until every supplied task reaches a terminal state — Completed, Error, Warning, Terminated, or Killed — or until the timeout expires.
Progress bars are displayed for each tracked task. If -Verbose is set, Write-Progress output is suppressed and status is written to the verbose stream instead.
When the timeout is reached before all tasks finish, the cmdlet throws a terminating error and returns whatever tasks have already completed.
This cmdlet is used in two main patterns:
- Inline (default): Most resource-modifying cmdlets complete synchronously because they call
Wait-OVTaskCompleteinternally. -Asyncpattern: Pass-Asyncto the source cmdlet to get the task object immediately, then pipe toWait-OVTaskCompleteto control when your script blocks.
Parameters
One or more task objects or task URI strings to monitor. Accepts:
- An
HPEOneview.Appliance.TaskResourceobject - A task URI string starting with
/rest/tasks/ - An array or pipeline of either
-TaskUri, -TaskMaximum time to wait before raising a timeout error. Defaults to the library-wide
$DefaultTimeout value (approximately 20 minutes).Example: -Timeout (New-TimeSpan -Minutes 30)Specify one or more appliance connection objects or names. Defaults to the default connection in
$ConnectedSessions.Examples
Wait for a single async task
Enable Remote Support on multiple servers asynchronously
Specify a custom timeout
Capture the completed task result for error checking
The -Async pattern explained
Output
HPEOneview.Appliance.TaskResource
The completed (or timed-out) task object is returned. Key properties:
| Property | Type | Description |
|---|---|---|
taskState | String | Final execution state (Completed, Error, etc.) |
taskStatus | String | Human-readable status or error message |
percentComplete | Int | Should be 100 on successful completion |
modified | DateTime | Timestamp of the last state change |
Related cmdlets
- Get-OVTask
- Stop-OVTask — see source repository for cmdlet usage