ironmansoftware / universal-automation

Universal Automation is the PowerShell-first automation platform.
https://ironmansoftware.com/universal-automation/
MIT License
24 stars 4 forks source link

Job Events #38

Open PorreKaj opened 4 years ago

PorreKaj commented 4 years ago

Describe the solution you'd like

The ability to define a Global scriptblock that executes on job failed, and the ability to define a per script scriptblock that supersedes the global one.

While you certainly could implement something like this in your scripts, wrapping your entire script in a try catch would be ugly. A solution like this would allow an admin to specify a default onfail action, (in my case, a short script to notify me via email) and specify a per script onfail action (for example report errors someone specific)

Doing error handling outside the script would also standardize the process, by setting a minimum level of reporting.

Describe how this would improve your Universal Automation Quality of Life

Error handling and reporting is one of the corner stones of a reliable product. More options would be great!

Describe alternatives you've considered

Doing it in-script.

adamdriscoll commented 4 years ago

What if you could assign a UAScript to execute on error? This would provide us with reporting about the error handler too.

PorreKaj commented 4 years ago

Fine by me :-)

PorreKaj commented 4 years ago

Something similar could be implemented for when a job needs feedback.

This way admins would be able to do something like "Send mail to invoker that feedback is needed"

Someone competent could even use this to implement a workflow that sends a form with the missing feedback, to be filled out returned via email, and grabbed through EWS. Getting all gitty here!

adamdriscoll commented 4 years ago

Changing the title of this. Also, reference a comment in another issue: https://github.com/ironmansoftware/universal-automation/issues/45#issuecomment-564498939

Seems like we need to be able to run scripts when certain events happen in UA. So far we have:

Windos commented 4 years ago

Just to throw some out there that could be handy:

That shutdown one may seem a bit weird, I'm thinking of the likes of the PowerShell Engine event "PowerShell.Exiting"

I've used it... I don't remember what sure, but having the option would be great.