$v=" "+$v.ToUpper() +" ";
if ($v.IndexOf(" "+$pcname+" ") -ge 0) { $returnval=$true; }
else { $returnval=$false; }
return$returnval;
}
Now it doesn't care what case the names are in - all are converted to uppercase (and it correctly matches the $v with the current computername)