3

When I run this:

Set-VMNetworkAdapter -VMName $vmName -Name "Network Adapter" -VMQ

I get this:

Set-VMNetworkAdapter : Missing an argument for parameter 'VmqWeight'. Specify a parameter of type 'System.Nullable`1[System.UInt32]' and
try again.
At line:1 char:62
+ Set-VMNetworkAdapter -VMName $vmName -Name "Network Adapter" -VMQ
+                                                              ~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VMNetworkAdapter], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Microsoft.HyperV.PowerShell.Commands.SetVMNetworkAdapter

So I try to add the VmqWeight:

Set-VMNetworkAdapter -VMName $vmName -Name "Network Adapter" -VMQ -VmqWeight 30

and I get this:

Set-VMNetworkAdapter : Missing an argument for parameter 'VmqWeight'. Specify a parameter of type 'System.Nullable`1[System.UInt32]' and
try again.
At line:1 char:62
+ ... VMNetworkAdapter -VMName $vmName -Name "Network Adapter" -VMQ -VmqWei ...
+                                                              ~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-VMNetworkAdapter], ParameterBindingException
    + FullyQualifiedErrorId : MissingArgument,Microsoft.HyperV.PowerShell.Commands.SetVMNetworkAdapter

I looked up -VmqWeight and it is supposed to have a value between -100 and 100.

What is the correct syntax to set these options on my VM?

2 Answers 2

2

With PowerShell logic, -VMQ is expanded to -VmqWeight. This argument requires a parameter, which you do not give. Your command must read:

Set-VMNetworkAdapter -VMName $vmName -Name "Network Adapter" -VMQ 30

(But you really should use the full parameter name anyway.)

2

The documentation for Set-VMNetworkAdapter does not mention a parameter named VMQ, only VmqWeight is listed.

Try the command without --VMQ.

1
  • Ah, thanks very much. I saw various things online that confused me on this. This works.
    – YorSubs
    Commented Feb 5 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .