WinPE Imaging Scripts Looping - zenworktodo

I'm back after my last post, which is found below. We're working on an older version of ZCM Server version 20.2.0.0 and zenworktodo.exe was not kicking off automatically.

I finally got some time to come back to it and found modifying the unattend.xml to put zenworktodo as the first synchro command will start the process.

I'm trying to expand on this a bit more now but I realize this is probably far from supported.

The solution I have now works just fine when you create a single ZenWorks Image task in the PreBoot Bundle but if I add a WinPE Imaging Script to do a bit of work before the image is laid down then the script will be downloaded and re-run continuously. I've tried putting the script before and after the imaging task and both will produce the same result of looping indefinitely. For instance, I want to run a "zisedit -c" to clear image safe data if this is a machine we're swapping out and it has to go on the spare shelf.

I can tell that zenworktodo is checking for work at the end of the script as I was able to modify the WinPE Imaging Script that was assigned to the device and the new imaging script ran instead of the previous one when it went through one of it's loops. I came across the commands zenworktodo.exe /setJustImaged and zenworktodo.exe /clearWorkToDo and it seems neither of those worked to clear the WinePE Imaging Script so it would continue onto the actual ZenWorks Image task. I also tried just putting everything into one WinPE Imaging Script to do

zisedit -c

img -rp image-name.zmg -ip=img-server

wpeutil reboot

But this would also loop seemingly ignoring the reboot command

Previous Post:  RE: WinPE Imaging zenworkstodo not automatically starting

ZCM Server version: 20.2.0.0