I am guessing this is what is causing the slow down since it uses get-scsilun over and over.
Function GetScsiTarget([string]$VMHost,[string]$SCSICanonicalName) {
$Lun = Get-SCSILun $SCSICanonicalName -VMHost $VMHost
$RuntimeName = $Lun | Select -ExpandProperty RuntimeName
return $RuntimeName
Would it be better to load get-scsilun for all hosts into a $string and search within that?
and i guess the same would be for function SearchFilers. Loading all the filers and their luns into a $string instead of connecting over and over
So you would recommend doing this to speed it up?