The parameter set is depending on the vSphere version. I have tested against an ESXi v6.0U2 server.
You can see the parameters needed using the following command:
$esxcli.system.module.parameters.set
The output of the preceding command is the following for me:
TypeNameOfValue : VMware.VimAutomation.ViCore.Util10Ps.EsxCliExtensionMethod
OverloadDefinitions : {boolean set(boolean append, boolean force, string module, string parameterstring)}
MemberType : CodeMethod
Value : boolean set(boolean append, boolean force, string module, string parameterstring)
Name : set
IsInstance : True
In the value of the OverloadDefinitions and Value properties, you can see the parameter set, where append is the first parameter, force is the second parameter, module is the third parameter and parameterstring is the fourth parameter. For the parameters you don't want to specify, you have to use $null.
Another solution will be to use the Get-EsxCli version 2 interface with the -V2 parameter. In this case, you can get the parameters in a hash table using the CreateArgs() method, using the following commands:
$esxcliv2 = Get-VMHost -Name 192.168.0.201 | Get-EsxCli -V2
$Parameters = $esxcliv2.system.module.parameters.set.CreateArgs()
Now, the variable $Parameters contains the parameter set in the following hash table:
Name Value
---- -----
module Unset, ([string])
parameterstring Unset, ([string])
append Unset, ([boolean], optional)
force Unset, ([boolean], optional)
You can set the required parameter values
$Parameters['module'] = 'lpfc'
$Parameters['parameterstring'] = 'lpfc_devloss_tmo=30'
And finally, use the Invoke() method to run the following command with the parameter set:
$esxcliv2.system.module.parameters.set.Invoke($Parameters)