I'm running an app in PowerShell like so:
$exe = "C:\blah\build\blah\Release\blahblah.exe"
&$exe scheduledRun sliceBicUp useEditionId
blahblah.exe is a C# .NET 4.5 Console App. Now I know this executable can throw errors etc. Can I catch these errors/exceptions within the PowerShell script itself?
Basically i want the PowerShell script to detect an error/exception has occurred and action something, like email our Helpdesk for example.