Apologies in advance for the long post. I've been playing around with Automation Tasks and wanted to know what will cause the task to be flagged as failed or successful. Basically I created a test task with a test machine in a test scope, added a bunch of random scripts to the task and ran it. All looked good and comes back as executed successfully. It wasn't until I actually go into the Execution History and look at the output that I find that some haven't actually completed successfully at all. One example is the Clean Temporary Files powershell script in which it receives an "Access Denied" message but continues on, I'm guessing due to the "-ErrorAction SilentlyContinue" flag:
I guess the point I'm getting at is that if the Automation Tasks all show successful but really one of the scripts didn't actually complete the job it set out to do, then in my books that's not a successful completion. The only way to check if it did actually run correctly is by going into the execution history and manually checking the output of the script. That could be quite painful if it was run against dozens of machines and kind of goes against what one tries to do when automating multiple tasks.
So, is the Automation Task flagged as successful if it just executes the scripts, not whether the scripts actually complete properly?