Jump to content
View in the app

A better way to browse. Learn more.

Pulseway

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi Guys,

 

 

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:

image.png.8b501f8417d64585579bd7cfe8fe9455.png

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?

 

Cheers,

Clive

 

  • Staff

Hi ElasticIT,

You will need to configure the exit code for your script (exit code 0 - success, exit code 1 - failure).

Example:

$files = @(get-childitem $fullpath)
if($files.Count -gt $count){exit 1}
else{exit 0}

 

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.