PowerShell provisioner and "expect_disconnect" option

Seems that the “expect_disconnect” is missing or maybe left out intentionally?

I have a use-case where I needed to wait across three reboots and this is problamatic to say the least.

I would have like to do:

        {
            "type":                 "powershell",
            "execute_command":      "{{.Path}}; exit $LastExitCode",
            "scripts":              "{{user `script_lcm`}}"
            "pause_before":         "5m",
            "expect_disconnect":    true,
            "start_retry_timeout":  "1m",
            "max_retries":          10
        },

My script would simply check for what needs to be checked to validate completion and then exit using a zero value exit code.

But. I cannot handle the reboot that are happing duing to DSC resources being enforced by the LCM. So I was hoping to monitor for the “Idle” state of the LCM and then continue on…

At the moment I’m failing with:

==> Builds finished but no artifacts were created.

1 error occurred:
        * unknown configuration key: '"expect_disconnect"'

Hi, thanks for reaching out. expect_disconnect is specific to the shell provisioner, and isn’t available for powershell. For waiting for reboots, we suggest you use the windows_restart provisioner with restart_check_command set.