Some weird pastage on the original post.
Let's see if this works better.
gci MSGTRK*.log -name |% {
$src_evt_ht = @{}
write-host
$_
gc $_ |
foreach {
if ($_.startswith("2"
){
$rec = $_ -split ","
$src_evt_ht[($rec[7] + "." + $rec[8])] += 1
}
}
write-host
$src_evt_ht
}