diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb index 0e56fd4b2..08e67a8f1 100644 --- a/lib/vagrant/plugin/v2/trigger.rb +++ b/lib/vagrant/plugin/v2/trigger.rb @@ -169,9 +169,13 @@ module Vagrant cmd = File.expand_path(config.path, @env.root_path) FileUtils.chmod("+x", cmd) + cmd << " #{config.args.join(' ' )}" if config.args + if Vagrant::Util::Platform.windows? powershell_exe = Vagrant::Util::PowerShell.executable cmd = Shellwords.split("#{powershell_exe} #{config.powershell_args} #{cmd}") + else + cmd = Shellwords.split(cmd) end @machine.ui.detail(I18n.t("vagrant.trigger.run.script", path: config.path)) diff --git a/website/source/docs/triggers/configuration.html.md b/website/source/docs/triggers/configuration.html.md index b0120a1a4..4fa90b7d9 100644 --- a/website/source/docs/triggers/configuration.html.md +++ b/website/source/docs/triggers/configuration.html.md @@ -30,6 +30,10 @@ Can be any valid Vagrant command. It also accepts a special value `:all` which w * `run_remote` (hash) - A collection of settings to run a inline or remote script with on the guest. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). -* `run` (hash) - A collection of settings to run a inline or remote script with on the host. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). +* `run` (hash) - A collection of settings to run a inline or remote script with on the host. These settings correspond to the [shell provosioner](/docs/provisioning/shell.html). However, at the moment the only settings `run` takes advantage of are: + + `args` + + `inline` + + `path` + + `powershell_args` * `warn` (string) - A warning message that will be printed at the beginning of a trigger.