From #1459 (comment).
The ExecutePSCommandAsync()
API should allow us to both print errors to the console and throw them to the caller so they can take appropriate action.
Then we can use a try
/catch
at the callsite to handle the behaviour accordingly.