esxcfg-vswitch -B both vSwitch0 is the ESXi command to change cdp setting to "both"
Is it possible to use powerCLI to configure this setting?
Have a look at Maish's post called How to Set CDP on a vSwitch–the #PowerCLI Way
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference