When a provisioning task fails in a Broker Plus Link due to a PowerShell error, the information written doesn't indicate which provisioning task failed, which line the error occurred on, or which entity was being processed.
It would be extremely helpful for debugging to know which provisioning task is the source of the error and which line is executing when the error occurs.
It would also be helpful to know which entity is being processed, but given that the PowerShell script loops over objects internally this information is not automatically available to the calling engine. In order to help with this I suggest adding a function which allows the PowerShell script to (optionally) indicate when it starts and finishes processing an entity, in order to allow Broker to include that information in the log entry.
foreach ($joinedEntity in $joinedEntities)
# Tell Broker which entity we're working on $personNumber = $SourceEntity["PersonNumber"].Value
$username = $SourceEntity["sAMUsername"].Value
$logger.setIdentifier("Person $personNumber ($username)")
# Process the entity $isTerminated = $joinedEntity.SourceEntity["Terminated"].Value
$joinedEntity.TargetEntity["isTerminated"] = $isTerminated -eq "True"
# Tell Broker we're finished processing the entity
Customer support service by UserEcho