HewlettPackard / POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
http://hewlettpackard.github.io/POSH-HPEOneView/
125 stars 52 forks source link

Get-OvLogicalInterconnectGroup -Name "XXXXXXXXX" -ErrorAction Stop | Set-OVUplinkSet -UplinkSetName "YYYYYYYYYY" -AddNetwork "ZZZZZZZZZZZZZ TaskState Error" #619

Closed kymra27 closed 1 year ago

kymra27 commented 1 year ago

Hello,

I contact you for this problem. when I add a network via the command:

Get-OvLogicalInterconnectGroup -Name "XXXXXXXXX" -ErrorAction Stop | Set-OVUplinkSet -UplinkSetName "YYYYYYYYYY" -AddNetwork "ZZZZZZZZZZZZZZ"

I receive in return an error message which indicates that the TaskState is in error. I don't have any details to solve this problem.

I logged into GUI and in Activity my error does not appear.

Do you have an idea ?

Regards,

2022-11-03 17_49_02-10 3 50 40 - Connexion Bureau à distance

ChrisLynchHPE commented 1 year ago

You need to capture the task object into a variable, then look at the .taskErrors property:

$task = Get-OvLogicalInterconnectGroup -Name "XXXXXXXXX" -ErrorAction Stop | Set-OVUplinkSet -UplinkSetName "YYYYYYYYYY" -AddNetwork "ZZZZZZZZZZZZZZ"
 if ($task.taskState -ne "Complete") {

    $task.taskErrors | ForEach { 
        Write-Host "Error Message" $_.details
        Write-Host "Recommended actions:" $_.recommendedActions
    }

}