vagrant/plugins/providers/hyperv/action/check_enabled.rb
Chris Roberts ea25996b21
Update Vagrant behavior outside of installers
Remove customized require behaviors and modify the bin executable
to check for missing tools that Vagrant expects to exist when
running outside of an installer.
2025-04-02 11:40:17 -07:00

25 lines
559 B
Ruby

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
require "fileutils"
require "log4r"
module VagrantPlugins
module HyperV
module Action
class CheckEnabled
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].output("Verifying Hyper-V is enabled...")
result = env[:machine].provider.driver.execute("check_hyperv.ps1", {})
raise Errors::PowerShellFeaturesDisabled if !result["result"]
@app.call(env)
end
end
end
end
end