Hi,
to initialize a new host we would like to bundle a few NICs to a virtual switch. In our script, we do
$vs = Get-VirtualSwitch -vmhost $vhost -name "vSwitch1"
set-virtualswitch -virtualswitch $vs -nic "vmnic2","vmnic3"
which works as intended. However, we always get a question (sorry about the german in the last line):
Perform operation?
Perform operation 'Configuring virtual switch.' on virtual switch 'vSwitch1'
[J] Ja [A] Ja, alle [N] Nein [K] Nein, keine [H] Anhalten [?] Hilfe (Standard ist "J"):
As far as we understand the documenation and all examples found, this should not happen. Do you have an idea on how to suppress this question?
Thanks in advance,
Morodin
Greetings, @Morodin71-
The Set-VirtualSwitch cmdlet (like many cmdlets) has the -Confirm parameter that can be used to add/remove this confirming question. So, the line would then become:
Set-VirtualSwitch -VirtualSwitch $vs -Nic "vmnic2","vmnic3" -Confirm:$false
Enjoy
Greetings, @Morodin71-
The Set-VirtualSwitch cmdlet (like many cmdlets) has the -Confirm parameter that can be used to add/remove this confirming question. So, the line would then become:
Set-VirtualSwitch -VirtualSwitch $vs -Nic "vmnic2","vmnic3" -Confirm:$false
Enjoy
I feel actually quite stupid
I tried the Confirm parameter, but used the wrong syntax, so that the parameter had no effect on the cmdlet.
Thanks for bringing me back on the right track
Oh, do not feel stupid -- sometimes we miss things.
Glad to help