I understand the difference between terminating and non-terminating errors. One stops the script and the other doesn't. My question is even with a terminating error like below, why doesn't it stop the script and cause write-host '2' not execute?
I'm under the impression $ErrorActionPreference only affects non-terminating errors behavior and not a terminating. So, no matter what the error $ErrorActionPreference is set to, a terminating error should still stop a script right? Here it is with $ErrorActionPreference set to 'Silently Continue'. I would still expect a terminating error to occur and stop execution in between. That doesn't happen though.