I haven't used the Exchange module much personally, but I've seen comments about -ErrorAction being flaky when used with implicit remoting. People seem to be able to work around it by setting $ErrorActionPreference, instead of using the -ErrorAction parameter. (This is annoying, and I'd call it a bug in PowerShell, but that's where things stand at the moment.)
Strange thing is it works just fine in every computer I have with PS version 4 (we use the same script in at least 6 different machines with Win7 or 2012), but on my laptop with PS version 5 and Win10 it won't.
The topic ‘Powershell 5 ErrorAction Stop’ is closed to new replies.