Skip to content

Vagrant Powershell CLI does now allow additional arguments #13724

@jackdneilson

Description

@jackdneilson

Debug output

vagrant powershell -- -ConfigurationName test
==> default: Detecting if a remote PowerShell connection can be made with the guest...
    default: Creating powershell session to 127.0.0.1:55985
    default: Username: vagrant
Cannot process command because a command is already specified with -Command or -EncodedCommand.

Expected behavior

Running vagrant powershell with additional parameters should process the additional parameters correctly, in this case attempting to use the session configuration "test".

Actual behavior

Regardless of what additional parameters are given, the error shown in debug output is printed.

Reproduction information

Attempt to run vagrant powershell with additional parameters using the -- syntax.

Vagrant version

Vagrant 2.4.9

Host operating system

Windows 10 22H2

Guest operating system

Windows 10 22H2

Steps to reproduce

  1. Attempt to run vagrant powershell with additional parameters using the -- syntax.
  2. The process fails with an error.

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "gusztavvargadr/windows-10"
  config.vm.box_version = "2506.0.0"
  config.vm.guest = :windows
  config.vm.communicator = "winrm"
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions