im writing a script to restore latest SQL backup to a file, and i got some errors so i tried to run the commands in powershell and got the result below.
In your further posts please use </> label to wrap your script examples and errors in code tags to make it clearer.
As for the issue, I do remember several bugs related to this powershell exception, but it is hard to find precise root cause without viewing the logs. Please open a support case and share its id here so that we could follow it up closely.