Since WWN can be retriever for HBA and/or LUN, you could do
foreach($dc in Get-Datacenter){
foreach($cluster in Get-Cluster -Location $dc){
foreach($esx in Get-VMHost -Location $cluster){
...
}
}
}
In the inner loop you could then get the HBA and/or LUN of the ESXi and extract the WWN.
Is that what you are looking for ?