Why is the Evaluation Code Skipped When I Manually Run a Worklet?

Why isn't my Worklet running the Evaluation Code when I run the policy manually?

When you are on either the device page or the policy page and you run a Worklet manually (manual remediation), the Evaluation Code you put in the worklet doesn't seem to be working.

Answer

  • When you run a policy manual remediation on a host, the Evaluation Code is skipped and only the Remediation Code is processed.
  • If you would like to test your evaluation code, you can schedule the policy to run in the near future, as scheduled executions process the evaluation code and the remediation code if the evaluation code passes.
  • Another way you can test your evaluation code would be to put the evaluation code in the remediation code section of a separate test worklet, and set the evaluation of that worklet to Exit 1. Then change the exit codes of your evaluation to Write-Output or Echo commands so that you can verify the response of the code through the Activity Log on the Reports Tab.
Was this article helpful?
0 out of 0 found this helpful