{"record":{"id":"3f8c998f066e8d55","repo":"hashicorp/vagrant","slug":"the-setting-powershell-args-is-not-supported-for","errorCode":null,"errorMessage":"The setting `powershell_args` is not supported for the trigger option `run` and will be ignored.","messagePattern":"The setting `powershell_args` is not supported for the trigger option `run` and will be ignored\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/kernel_v2/config/vm_trigger.rb","lineNumber":243,"sourceCode":"          commands = Vagrant.plugin(\"2\").manager.commands.keys.map(&:to_s)\n\n          if !commands.include?(@command) && @command != :all\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.bad_command_warning\",\n                                  cmd: @command))\n          end\n        end\n\n        if @run\n          errorz = @run.validate(machine)\n          errors.concat errorz[\"shell provisioner\"] if !errorz.empty?\n\n          if @run.privileged == true\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.privileged_ignored\",\n                                  command: @command))\n          end\n\n          if @run.powershell_args != \"\"\n            machine.ui.warn(I18n.t(\"vagrant.config.triggers.powershell_args_ignored\"))\n          end\n        end\n\n        if @run_remote\n          errorz = @run_remote.validate(machine)\n          errors.concat errorz[\"shell provisioner\"] if !errorz.empty?\n        end\n\n        if @name && !@name.is_a?(String)\n          errors << I18n.t(\"vagrant.config.triggers.name_bad_type\", cmd: @command)\n        end\n\n        if @info && !@info.is_a?(String)\n          errors << I18n.t(\"vagrant.config.triggers.info_bad_type\", cmd: @command)\n        end\n\n        if @warn && !@warn.is_a?(String)\n          errors << I18n.t(\"vagrant.config.triggers.warn_bad_type\", cmd: @command)","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/kernel_v2/config/vm_trigger.rb#L225-L261","documentation":"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.","triggerScenarios":"A trigger block containing `t.run = { inline: \"...\", powershell_args: \"-ExecutionPolicy Bypass\" }` (any value other than the empty string triggers the warning).","commonSituations":"Reusing shell-provisioner option hashes for Windows guests in trigger run options; attempting to control PowerShell host-side execution flags.","solutions":["Remove powershell_args from the run option hash; embed any needed flags directly in the inline command","If the command targets the guest, move the options to `t.run_remote`, where shell provisioner options apply"],"exampleFix":"# before\nconfig.trigger.after :up do |t|\n  t.run = { inline: \"winrm quickconfig\", powershell_args: \"-ExecutionPolicy Bypass\" }\nend\n# after\nconfig.trigger.after :up do |t|\n  t.run = { inline: \"powershell -ExecutionPolicy Bypass -Command \\\"winrm quickconfig\\\"\" }\nend","handlingStrategy":"validation","validationCode":"# Lint trigger run hashes: powershell_args belongs to run_remote only\nraise \"powershell_args ignored for trigger run\" if trigger_run[:powershell_args] && trigger_run[:powershell_args] != \"\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bake PowerShell flags into the inline command string for host-side runs","Move powershell_args to run_remote when targeting Windows guests","Remember any non-empty value triggers the warning, including defaults copied from provisioner templates"],"tags":["vagrant","triggers","powershell","run-option"],"backgroundTag":"ignored-config-option","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}