Hi,
I am unable to get the HBA parameters from the below command as I can getting the below error
$esx_host = get-vmhost 'myesx10.mydomain.com'
$esxcli = Get-EsxCli -VMhost $esx_host -v2
$esxcli.system.module.parameters.list.Invoke('iscsi_vmk')
Error
If specified, the arguments parameter must contain a single value of type Hashtable.
At line:1 char:1
+ $esxcli.system.module.parameters.list.Invoke('iscsi_vmk')
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException
Yes, that looks correct
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you use the V2 version of Get-EsxCli, you have to pass your arguments in a hash table.
See PowerCLI 6.3 R1: Get-ESXCLI Why the V2? for more info
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
I tried as below, let me know, if this is right ?
$esx_host = get-vmhost 'myesx10.mydomain.com'
$esxcli = Get-EsxCli -VMhost $esx_host -v2
$arguments = $esxcli.system.module.parameters.list.CreateArgs()
$arguments.module = 'iscsi_vmk'
$esxcli.system.module.parameters.list.Invoke($arguments)
Yes, that looks correct
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference