2014-02-15 23:29:16 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module HyperV
|
|
|
|
module Action
|
2014-02-16 19:31:33 +00:00
|
|
|
class StopInstance
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
2014-02-15 23:29:16 +00:00
|
|
|
|
2014-02-16 19:31:33 +00:00
|
|
|
def call(env)
|
2014-02-26 19:57:17 +00:00
|
|
|
env[:ui].info("Stopping the machine..."))
|
2014-02-16 19:42:20 +00:00
|
|
|
options = { VmId: env[:machine].id }
|
2014-02-16 19:31:33 +00:00
|
|
|
env[:machine].provider.driver.execute('stop_vm.ps1', options)
|
|
|
|
@app.call(env)
|
2014-02-15 23:29:16 +00:00
|
|
|
end
|
2014-02-16 19:31:33 +00:00
|
|
|
end
|
2014-02-15 23:29:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|