Hi LucD,
Thanks for your update.
Did you mean to use the following. If yes then I have tried but still not working:
Invoke-SSHCommand -InvokeOnAll -Command 'esxcfg-vswitch -l | grep vSwitch | awk '{print $1,$2}''
Since in powercli $ sign is generally used for declaring a variable so it is not working.
So is there any way that powercli ignore $ sign mentioned in the command.