packer-community / packer-windows-plugins

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

powershell provisioner input stream hangs ps1 script #32

Closed remy-tiitre closed 9 years ago

remy-tiitre commented 9 years ago

I think powershell plugin has similar problem than puppet, chef and other tools have had in the past. Read more about it here http://stackoverflow.com/questions/4238192/running-powershell-from-msdeploy-runcommand-does-not-exit/4239192#4239192

At least on Windows 7 with powershell provisioner, my scripts will hang.

The solution is to either add -inputformat none argument to the execution command. But as this workaround is undocumented feature, it might be more reasonable to add < CON at the end, as also suggested in the same thread. Some people also use < NUL.

mefellows commented 9 years ago

This is interesting. Are you provisioning a Windows 7 machine or is Packer running on Windows 7? It should only be a problem in the latter case where PoSH is actually executing.

In either case, are you able to provide a gist or something that includes a test case so we can try to reproduce and fix locally?

mefellows commented 9 years ago

Closing due to inactivity. Please feel free to re-open if you are able to provide more detail as requested.