VMware Cloud Community
dawoo
Enthusiast
Enthusiast
Jump to solution

Traffic shaping policy - "A specified parameter was not correct"

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 Smiley Wink

Cheers,

Darren.

10 Print "It's all about the Nerdknobs" , 20 GOTO http://blog.vmote.net/
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
2 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
dawoo
Enthusiast
Enthusiast
Jump to solution

Genius! Points awarded and please someone shoot me (not fatal though) for not being observant.

Thank you very much.

Cheers,

Darren.

10 Print "It's all about the Nerdknobs" , 20 GOTO http://blog.vmote.net/
0 Kudos