Compare the content of error reports produced by the custom logic implemented in the PowerShell worker with the content the new Get-Error cmdlet produces. If all the relevant data is present, just replace the custom code with a Get-Error invocation. If something important is missing, consider filing a PowerShell issue instead.