gpt4 book ai didi

powershell - 无法通过VirtualBox中的PowerShell脚本运行Vagrant命令

转载 作者:行者123 更新时间:2023-12-02 23:25:32 26 4
gpt4 key购买 nike

我尝试在VirtualBox中安装的Windows 10的大脚本结尾处运行以下2条命令:

#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

但是我收到一个错误:
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

但是我可以分别通过PowerShell和PowerShell ISE运行这些命令。另外,我也不知道为什么,PowerShell执行带有注释行的Vagrant命令。

最佳答案

尝试用vagrant替换vagrant.exe

关于powershell - 无法通过VirtualBox中的PowerShell脚本运行Vagrant命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37941182/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com