SyntaxFix
Write A Post
Hire A Developer
Questions
-ErrorAction Stop is changing things for you. Try adding this and see what you get:
-ErrorAction Stop
Catch [System.Management.Automation.ActionPreferenceStopException] { "caught a StopExecution Exception" $error[0] }