In the vSphere client, we can see a list of HBAs. This helps us identify what vmhba0, vmhba1, etc. are (i.e. which one is local storage, which one is FC, etc.). How do I do this in PowerCLI? A cmdlet would be nice.
I know how to enable software iSCSI. After that, I need to add the target. I know how to do that, but it requires the software iSCSI HBA. It might be vmhba32, vmhba33, etc. How do I determine the software iSCSI HBA? A cmdlet would be nice.
The easiest way to get the information you need is :
get-vmhost "YourESXHostName" | get-vmhosthba
The default output should get you what you need. I unfortunately can't help you with iSCSI as it isn't something we use in our environment and I'm not 100% familiar with it.
The command ae_jenkins posted will give you information about all HBAs on the host. If you want just the iSCSI HBAs, then you can filter them like this:
Get-VMHost "HostName" | Get-VMHostHba -Type iScsi
PowerCLI development team