Seems -ErrorAction Stop is not supported. E.g. when uploading a new document the command just hangs and never returns. Can someone confirm?
There can be an error e.g. when the token dies and this seems to be a non-terminating error that lets the script that continue unless stopped. Rendering any try catch useless.