Did you use the V2 switch on the Get-EsxCli cmdlet?
Then you could use a hash table with the arguments.
Something like this for example
$esxcli.storage.core.device.inquirycache.set.Invoke(@{device=$naa;ignore=$true})
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I love that I can't seem to edit the main post....
This would be the ESXICLI command
esxcli storage core device inquirycache set --device device id --ignore true
storage core device inquirycache set | Manipulate inquiry cache settings of storage devices. | --apply-all Operate on all existing devices. --device | -d NAA ID of the device upon which to operate. --ignore Ignore device inquiry cache. (required) --help Show the help message. |
I thought it would be something like below but it not.
$myesxcli.storage.core.device.inquirycache.set ($NAA, $ignore)
Any suggestions?
Did you use the V2 switch on the Get-EsxCli cmdlet?
Then you could use a hash table with the arguments.
Something like this for example
$esxcli.storage.core.device.inquirycache.set.Invoke(@{device=$naa;ignore=$true})
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you again Sir! As always you are a rockstar.
The snippet of code to perform this bit of configuration.
##Connect to vCenter
Connect-VIServer "<your vcenter>"
##Outer Loop
Foreach ($EsxiHost in (Get-Content -Path C:\PowerShellScripts\esxi-host-list.txt))
{
$myesxcli = Get-EsxCli -VMHost $esxihost -V2
#Inner Loop
Write-Host "Working on host $esxihost"
Foreach ($RDMNAA in (Get-Content -Path C:\PowerShellScripts\RDM-NAA-list.txt))
{
##Enable
$myesxcli.storage.core.device.inquirycache.set.Invoke(@{device=$RDMNAA;ignore=$true})
##Disable
#$myesxcli.storage.core.device.inquirycache.set.Invoke(@{device=$RDMNAA;ignore=$falese})
}
}
Michael