I have been looking for a while, but can someone help me with getting the iSCSI wwn into a variable. I am trying to pipe this into a command to add this to a netapp initiator group. My code is below: From this I can enable iSCSI and then configure my iSCSI target, but when I write-host the information the WWN does not appear so obviously I can not add the initiator to a netapp igroup as seen in the second section of code.
$myhost = Get-VMHost -name 192.168.10.74
Get-VMHostStorage $myhost | Set-VMHostStorage -SoftwareIScsiEnabled $true
$iscsiHBA = Get-VMHostHBA -VMHost $myhost -Type iSCSI
$iscsiHBA | New-IscsiHBATarget -Address $iscitarget -Type send
Write-Host $iscsiHBA
Connect-NaController $filer -Credential $Filercredentials
$iscsiHBA | Add-NaIgroupInitiator -Igroup vmware -Initiator $iscsiHBA
Any help on this would be great.