Make shutdown work on Nano Server

This commit is contained in:
le-garff-yoann 2018-07-25 23:46:09 +02:00
parent 0ee1d82359
commit a951e8d90f

View file

@ -8,7 +8,11 @@ module VagrantPlugins
machine.communicate.execute("shutdown -a", error_check: false)
# Force shutdown the machine now
machine.communicate.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f /d p:4:1")
begin
machine.communicate.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f /d p:4:1")
rescue Vagrant::Errors::VagrantError
machine.communicate.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f")
end
end
end
end