PowerShell provisioner not fail on disconnect?

Does the PowerShell provisioner not fail if the connection to the remote machine is lost in the middle of running the script?
I would expect it to fail, or at least have the option to turn failing on, if, say, the provision PowerShell script causes an immediate reboot. That isn’t what I am seeing: It merrily carries on.

I think the PowerShell provisioner is missing the “expect_disconnect” which the normal shell provisioner has. This is where I’m struggling at the moment as well.

I’m using Packer to kick off a few DSC resources and they will reboot at leat 3 times before completing so I’m trying to monitor the LCM state and wait for the “Idle” state until moving on. But this turned out to be difficult.

1 Like