I am brand new to powershell but I'm hoping to learn it so I can better manage my VMs.
I've got HyperV running on "Server 2008 R2 Datacenter" with your brilliant library added.
I've set up 8 vms all using powershell so I'm very pleased with myself :)
The problem I have run into is when I try to add Pass Through Disks.
I have set up 10 Offline disks and I can assign them correctly when using the HyperV MMC, however, when I try to use Powershell I get no joy
In my example I have a server named SVPN2-VM03
I want to add it to the 3rd available target to be its only hard drive
I entered the command below (the vm name is stored in the variable)
Add-VMPassThrough $vm 0 0 (Select-VMPhysicalDisk)
I was then prompted to choose an ID but after that it returns an error (see below)
Add-VMPassThrough : A positional parameter cannot be found that accepts argument 'SVPN2-VM3'.
At line:1 char:18
- Add-VMPassThrough <<<< $vm 0 0 (Select-VMPhysicalDisk)
- CategoryInfo : InvalidArgument: (:) [Add-VMPassThrough], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Add-VMPassThrough
It seems like something is missing? Have I made a mistake or is it a bug?
I've attached a picture of the error and what I am able to do through the GUI of the HyperV MMC