VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Error :: If specified, the arguments parameter must contain a single value of type Hashtable

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

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Yes, that looks correct


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

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)

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, that looks correct


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos