I'm automating the restore of some databases on a server so it can be done with a few clicks, and I've been pretty successful so far. The part I'm somewhat stuck on is how to retrieve an error when a restore fails for whatever reason.
Here's my workflow:
- Start-VBRDatabaseRestore and collect the $sessionId
- Get-VBRRestoreSession -Id $sessionId every 15s and loop until the `Result` is -ne "None", meaning its finished in some fashion
- ??? Get Error ??? - <--- this is the part I can't yet figure out
- Report Error
On the RestoreSession object, there's a JobId, but it appears to be used in conjunction with the Export-VBRLogs method. Does anyone have any suggestions? In the Veeam Backup and Replication list of Sessions, I can see that the Restore Session has a Log Message that's marked as failed (an artificial disk space shortage

Thanks in advance!
Hugh