通过PowerShell在Vagrant框中安装Windows证书

时间:2016-08-05 14:16:55

标签: powershell vagrant

我想通过PowerShell在基于Windows的Vagrant机器上安装Windows证书。

我尝试使用此命令

 vagrant.exe powershell - c "Import-Certificate -Filepath C:\vagrant\Microcosm.cer"

但我恢复了错误

vagrant.exe : The machine with the name '-' was not found configured for
At line:1 char:1
+ vagrant.exe powershell - c "Import-Certificate -Filepath C:\vagrant\M ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (The machine wit... configured for:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

this Vagrant environment.

1 个答案:

答案 0 :(得分:0)

难道你的命令错字了吗?在powershell动词之后,不应该是-c而不是- c(请注意空格)。