Hi.
Here's a question for all you syntax checking code cutting gurus.
I have a requirement to set the traffic shaping policy outside of esxcfg commands so need to complete in PS. I jumped straight to Alan's website and found this marvellous example but when I copy / paste it, change vSwitch1 for vSwitch0 it returns the message.
Exception calling "UpdatePortGroup" with "2" argument(s): "A specified parameter was not correct.
Vim.Host.PortGroup::Specification::vswitchId"
At :line:22 char:28
++ $mor.UpdatePortGroup <<<< ($pgName, $portgrp)+
The URL for the code is here :
Any suggestions where I'm mis-understanding will be rewarded with points
Cheers,
Darren.
Hi Darren,
I tried the code on my system and changed vSwitch1 to vSwitch0 and got the same error as you did. Then I saw that you have to change vSwitch1 to vSwitch0 on two places in the code, line 3 and line 4. After I changed both places it worked perfectly.
Regards, Robert
Hi Darren,
I tried the code on my system and changed vSwitch1 to vSwitch0 and got the same error as you did. Then I saw that you have to change vSwitch1 to vSwitch0 on two places in the code, line 3 and line 4. After I changed both places it worked perfectly.
Regards, Robert
Genius! Points awarded and please someone shoot me (not fatal though) for not being observant.
Thank you very much.
Cheers,
Darren.