Skip to main content

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

Get HPE OneView task objects that track the progress of long-running appliance operations.

Syntax

Default

Get-OVTask
    [-Name <String>]
    [-InputObject <Object>]
    [-State <String[]>]
    [-Count <Int>]
    [-ApplianceConnection <Object>]
    [<CommonParameters>]

ResourceCategory

Get-OVTask
    [-Name <String>]
    [-ResourceCategory <String>]
    [-State <String[]>]
    [-Count <Int>]
    [-ApplianceConnection <Object>]
    [<CommonParameters>]

Description

Get-OVTask returns HPEOneview.Appliance.TaskResource objects that represent asynchronous operations tracked by HPE OneView. Most resource-modifying cmdlets return a task when the appliance cannot complete the operation synchronously. Tasks are sorted by last-modified date, most recent first. You can filter by:
  • Name — the task type name (e.g., Add server hardware).
  • State — task execution state (Running, Completed, Error, etc.).
  • InputObject — a specific resource name, URI, or object.
  • ResourceCategory — the REST category string of associated resources (e.g., server-hardware).
  • Count — a maximum number of records to return.
To block script execution until a task finishes, pipe the result to Wait-OVTaskComplete.

Parameters

Name
String
Filter tasks whose name property equals this value. The name is the task type description, such as Add server hardware or Update server profile.Alias: -TaskName
InputObject
Object
Scope results to tasks associated with a specific resource. Accepts:
  • A resource name string
  • A resource URI string (starting with /rest/)
  • A resource object with a uri property
Alias: -Resource
ResourceCategory
String
Filter by the REST resource category of the associated resource. Examples: server-hardware, enclosures, server-profiles, logical-interconnects.Alias: -Category
State
String[]
Filter by task execution state. Multiple values can be provided. Valid values:
  • Unknown
  • New
  • Running
  • Pending
  • Stopping
  • Suspended
  • Terminated
  • Killed
  • Completed
  • Error
  • Warning
Count
Int
Maximum number of tasks to return. Defaults to 0 (all tasks matching filters). When -Count is specified, results are also sorted by creation date descending.
ApplianceConnection
Object
Specify one or more appliance connection objects or names. Defaults to the default connection in $ConnectedSessions.

Examples

Get all currently running tasks

Get-OVTask -State Running

Get the 20 most recently completed tasks

Get-OVTask -State Completed -Count 20

Get tasks associated with a specific server

$server = Get-OVServer -Name 'Encl1, Bay 1'
Get-OVTask -InputObject $server

Get all error tasks for server profiles

Get-OVTask -State Error -ResourceCategory server-profiles

Get tasks by name (task type)

Get-OVTask -Name 'Update server profile'

Check task state and wait if still running

$task = Get-OVTask -State Running | Select-Object -First 1
if ($task)
{
    $task | Wait-OVTaskComplete
}

Output

HPEOneview.Appliance.TaskResource Key properties:
PropertyTypeDescription
nameStringTask type description
taskStateStringCurrent execution state
taskStatusStringDetailed status message
percentCompleteIntCompletion percentage (0–100)
associatedResource.resourceNameStringName of the resource the task operates on
associatedResource.resourceCategoryStringResource category
createdDateTimeWhen the task was created
modifiedDateTimeWhen the task was last updated
uriStringURI of the task resource
isCancelleableBooleanWhether the task can be cancelled with Stop-OVTask

Build docs developers (and LLMs) love