簡體   English   中英

無法通過 VirtualBox 中的 PowerShell 腳本運行 Vagrant 命令

[英]Unable to run Vagrant commands through PowerShell script in VirtualBox

我嘗試在安裝在 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.exe替換vagrant

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM