packer-community / packer-windows-plugins

A suite of Packer plugins for provisioning Windows machines
113 stars 20 forks source link

Powershell provisioner exit status #34

Closed pall-valmundsson closed 9 years ago

pall-valmundsson commented 9 years ago

I had issues using the powershell provisioner. When an exception is thrown or the exit code for any reason is anything else than zero it's ignored and building happily continues and you probably don't get the box you expected.

I "fixed it" by overriding execute_command with "powershell \"& { {{.Vars}}{{.Path}}; exit $LastExitCode }\"". I'm not proficient enough in Go to confidently submit a PR, but I would guess this needs changing.

mefellows commented 9 years ago

Thanks @pall-valmundsson, I've seen a few strange issues like this recently myself - I'll look at this shortly.

Looks like someone literally created a similar bug #35.

mefellows commented 9 years ago

Put together simple test case for this at https://gist.github.com/mefellows/32e5ca354a6c3255bc16 which I'm working to make pass locally.

mefellows commented 9 years ago

Closed due to #36