You could read the WWN into an array and then use the Contains operator to check if the current device belongs to your list of targets.
Something like this
$wwn=Get-Content-PathC:\WWN.txt
$esxHosts=Get-VMHost-Location$mycluster|SortName
foreach($esxin$esxHosts) { $esxcli=Get-EsxCli-VMHost$esx
$esxcli.storage.nmp.device.list() |where {$wwn-contains$_.Device}|%{ $esxcli.storage.nmp.psp.roundrobin.deviceconfig.set($null,$_.Device,1,"iops",$null) } }