Closed begunrom closed 4 years ago
This is expected behaviour. The returned error is included in the console output you have provided.
To handle errors, consider
ErrorVariable
$Error
Variabletry{
Get-PASAccount -search LockedAccount | Get-PASAccountPassword
}
catch {
throw $PSItem
}
Finally{
$Error[0]
}
try{
Get-PASAccount -search LockedAccount | Get-PASAccountPassword -ErrorVariable DidNotWork
}
catch {
throw "Some Error"
}
$DidNotWork
$Error[0]
Thanks
Describe the issue If account ischecked out by a user, a CPM operation fails (is normal), but does not return an error in the object.
To Reproduce Steps to reproduce the behavior:
Expected behavior Expected to see an error object beenr eturned. cable, add screenshots to help explain your problem.
Console Output Code Block: $e` = Invoke-PASCPMOperation -AccountID 27_402 -ChangeTask
Invoke-PASRestMethod : [500] Can not modify object GDCVMSS01.test.org-Administrator-5b81839e-2d32-4a20-9223-c5610d1d9246. Object is locked by xxxx. At line:287 char:4 Invoke-PASRestMethod @ThisRequest