Hi, i am pretty new with powerCLI in general and was wondering about this.
I am trying to change LLDP settings on multiple hosts in our VMware Cluster, this is the result:
Get-cluster -name "VMCluster" | get-vmhost |`
%{ Write-Host $_.Name ; `
(Get-Esxcli -v2 -VMHost $_).system.module.parameters.set.invoke(@{module="i40en"}).invoke(@{parameterstring="LLDP=0,0,0,0,0,0,0,0"})}
No value is specified for the mandatory parameter 'parameterstring'.
At line:3 char:4
+ (Get-Esxcli -v2 -VMHost $_).system.module.parameters.set.invoke(@{ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], InvalidArgument
+ FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.InvalidArgument
It seems like it doesn't like the second ".invoke" i am trying to do, not recognizing the parameterstring (-p) paramater, does anyone have a clue how to get this working?
When you use the V2 version of Get-EsxCli you have to provide all the parameters in a hash table.
See PowerCLI 6.3 R1: Get-ESXCLI Why the V2? for the details.
%{
Write-Host $_.Name
(Get-Esxcli -v2 -VMHost $_).system.module.parameters.set.Invoke(@{module="i40en"; parameterstring="LLDP=0,0,0,0,0,0,0,0"})
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When you use the V2 version of Get-EsxCli you have to provide all the parameters in a hash table.
See PowerCLI 6.3 R1: Get-ESXCLI Why the V2? for the details.
%{
Write-Host $_.Name
(Get-Esxcli -v2 -VMHost $_).system.module.parameters.set.Invoke(@{module="i40en"; parameterstring="LLDP=0,0,0,0,0,0,0,0"})
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference