2

I try to run these 2 commands in the end of big script in Windows 10 which is installed in VirtualBox:

#Navigate to folder where Vagrant file will be placed

CD "D:\VagrantBoxes\Win8"

#mount Windows box

vagrant init windows_81x64-enterprise_virtualbox_15.07.17.box

#run Vagrant

vagrant up

But I receive an error:

vagrant : The term 'vagrant' is not recognized as the name of a cmdlet,  function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At F:\Scripts\Install_Vagrant.ps1:3 char:1
+ vagrant up
+ ~~~~~~~
+ CategoryInfo          : ObjectNotFound: (vagrant:String) [],   CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

But I can run these commands via PowerShell and PowerShell ISE severally. Also, I don't know why, PowerShell is executed Vagrant commands with comment lines.

6
  • vagrant is probably not in the path. Just write $env:path -split ';' and check whether the vagrant bin directory is there Commented Jun 21, 2016 at 10:05
  • Martin, here is an output PS C:\VagrantBoxes\Win8> $env:path -split ';' C:\Windows\system32 C:\Windows C:\Windows\System32\Wbem C:\Windows\System32\WindowsPowerShell\v1.0\ C:\ProgramData\chocolatey\bin C:\HashiCorp\Vagrant\bin C:\PROGRA~2\Oracle\VirtualBox So yes, Vagrant bin is there. Commented Jun 21, 2016 at 10:10
  • Martin, it work! Thanks again - PowerShell God! Commented Jun 21, 2016 at 10:45
  • How did you solve it? was was the issue? Commented Jun 21, 2016 at 10:46
  • Yes, the problem was in .exe file extension. So you need add .exe after each Vagrant commands. Commented Jun 21, 2016 at 10:50

1 Answer 1

3

Try to replace vagrant with vagrant.exe

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, the problem was in .exe file extension. So you need add .exe after each Vagrant commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.