Ich habe diese Zeilen, die ich mag würde zu Vagrant-Datei hinzufügen, die ich über Powershell erstellen möchtenerstellen Vagrant Datei über Powershell
Vagrant.configure("2") do |config|
config.vm.communicator = "winrm"
config.vm.box = "Win_10_V.box"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "on"]
vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'SmartCard', '--vendorid', '0x096E', '--productid', '0x0007']
vb.gui = true
end
end
Ich habe versucht, diese Powershell-Cmdlets aber wegen mehrerer nicht funktioniert "Symbole.
New-Item "D:\VV\Vagrantfile" -type file -force -value "Vagrant.configure("2") do |config|
config.vm.communicator = "winrm"
config.vm.box = "W_1.box"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "on"]
vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'SmartCard', '--vendorid', '0x096E', '--productid', '0x0007']
vb.gui = true
end
end"
Hier ist Fehlerausgang
New-Item : A positional parameter cannot be found that accepts argument '2) do |config|
config.vm.communicator = winrm
config.vm.box = Win_10_V.box
config.vm.provider virtualbox do |vb|
vb.customize [modifyvm, :id, --usb, on]
vb.customize [modifyvm, :id, --usbehci, on]
vb.customize ['usbfilter', 'add', '0', '--target', :id, '--name', 'SmartCard', '--vendorid', '0x096E', '--productid', '0x0007']
vb.gui = true
end
end'.
At line:1 char:1
+ New-Item "D:\VV\Vagrantfile" -type file -force -value "Vagrant.configu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-Item], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewItemCommand
ich weiß, dass ich Posi haben Ich brauche sie in meinem Vagrandile
Vielen Dank! Jetzt funktioniert alles wie erwartet. –