hashicorp/vagrant · warning

The setting `powershell_args` is not supported for the trigg

Error message

The setting `powershell_args` is not supported for the trigger option `run` and will be ignored.

What it means

The powershell_args setting only applies to guest-side shell provisioners, not to a trigger's host-side `run` command. When run.powershell_args is set to any non-empty string, validation warns that the value is unsupported for `run` and will be ignored.

Source

Thrown at plugins/kernel_v2/config/vm_trigger.rb:243

          commands = Vagrant.plugin("2").manager.commands.keys.map(&:to_s)

          if !commands.include?(@command) && @command != :all
            machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
                                  cmd: @command))
          end
        end

        if @run
          errorz = @run.validate(machine)
          errors.concat errorz["shell provisioner"] if !errorz.empty?

          if @run.privileged == true
            machine.ui.warn(I18n.t("vagrant.config.triggers.privileged_ignored",
                                  command: @command))
          end

          if @run.powershell_args != ""
            machine.ui.warn(I18n.t("vagrant.config.triggers.powershell_args_ignored"))
          end
        end

        if @run_remote
          errorz = @run_remote.validate(machine)
          errors.concat errorz["shell provisioner"] if !errorz.empty?
        end

        if @name && !@name.is_a?(String)
          errors << I18n.t("vagrant.config.triggers.name_bad_type", cmd: @command)
        end

        if @info && !@info.is_a?(String)
          errors << I18n.t("vagrant.config.triggers.info_bad_type", cmd: @command)
        end

        if @warn && !@warn.is_a?(String)
          errors << I18n.t("vagrant.config.triggers.warn_bad_type", cmd: @command)

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Remove powershell_args from the run option hash; embed any needed flags directly in the inline command
  2. If the command targets the guest, move the options to `t.run_remote`, where shell provisioner options apply

Example fix

# before
config.trigger.after :up do |t|
  t.run = { inline: "winrm quickconfig", powershell_args: "-ExecutionPolicy Bypass" }
end
# after
config.trigger.after :up do |t|
  t.run = { inline: "powershell -ExecutionPolicy Bypass -Command \"winrm quickconfig\"" }
end
Defensive patterns

Strategy: validation

Validate before calling

# Lint trigger run hashes: powershell_args belongs to run_remote only
raise "powershell_args ignored for trigger run" if trigger_run[:powershell_args] && trigger_run[:powershell_args] != ""

Prevention

When it happens

Trigger: A trigger block containing `t.run = { inline: "...", powershell_args: "-ExecutionPolicy Bypass" }` (any value other than the empty string triggers the warning).

Common situations: Reusing shell-provisioner option hashes for Windows guests in trigger run options; attempting to control PowerShell host-side execution flags.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/3f8c998f066e8d55. Report an issue: GitHub.