Packer issue - Powershell script provisioner - VM Reboot

Hello all,
I have a stack overflow post which has not gained any traction yet

Basically packer throw an error and reverts / cleans up anytime I try running a powershell script provisioner, in which the script forces the vm to reboot.

I’ve read about issues with VMs rebooting, which wasn’t invoked by packer it’s self

I’ve tried adding in pause_after, Windows-restart provisioners, check_commands for the Pending_reboot registry keys…
Nothing seems to make packer reconnect after the vm reboots from my powershell script.

Any help would be greatly appreciated.

The stack over flow post has logs abs build scripts for more details

Thank you

I’m really surprised this hasn’t been answered. Facing the same issue but noticed a comment in the windows-restart provisioner that best-practice is to handle all reboots during the unattend part. Not really always possible. I could think of a solution where error handling is turned off by using a custom execute_command and then simply waiting on the next step and check/handle a potential error there. But not really a clean way of handling it.

Really no input here from “Packer emps”?