I would like to create a global error handler in the PowerShell console that will always work without explicit declaration.
One (but not only) of its usages is when a user enters some directory path (without Set-Location) it will automatically switches to that directory. Now it raises an error of course.
Is it possible to implement such a handler? I tried to wrap everything with try catch in profile (C:\Users\...\Documents\PowerShell\profile.ps1) but it didn't help in the REPL.
