Skip to main content
Question

write-output in worklet eval section doesn't show up in activity log

  • September 28, 2022
  • 1 reply
  • 305 views

Forum|alt.badge.img

I have some very basic code in the eval section of a worklet, as well as the remediation section. The output from the remediation sections shows up in the activity log, but the eval output does not. What am I doing wrong?

 

$sysInfo = New-Object -ComObject "Microsoft.Update.SystemInfo"
if($sysInfo.RebootRequired)

    write-output "pending reboot required"
    exit 1
}
else
{
    write-output "no pending reboot required."
    exit 0
}

 

 

1 reply

  • Automox Employee
  • September 29, 2022

Hey Steve,

Evaluation code isn’t reported back to the Activity Log, only Remediation Code is. This is because Evaluation code only cares about the exit codes and doesn’t rely or depend on any other actions. You have your exit codes correct however, as an exit 1 will move on the Remediation code for a reboot, while the exit 0 will stop there and mark the device as compliant.

 

More information on Worklets can be found below

https://help.automox.com/hc/en-us/articles/5352119754260-About-Worklets

 

Thank you.