Advanced Windows PowerShell Event 2
Check out the Windows PowerShell solution written by Microsoft Premier Field Engineer Ben Pearce
I did about the same, building a result set of objects first but I did that in one line :
$Skaters = gc c:\scripts\skaters.txt |select @{n='Name';e={$_.split(',')[0]}},@{n='Score';e={(([int[]]$_.split(',')[1..7] | sort)[1..5] | measure-object -a ).average}} | sort score -desc
"Gold Medal : {0}, {1}" -f $Skaters[0].name , $Skaters[0].Score
"Silver Medal : {0}, {1}" -f $Skaters[1].name , $Skaters[1].Score
"Bronze Medal : {0}, {1}" -f $Skaters[2].name , $Skaters[2].Score
You see no need for a disconnected recordset here in PowerShell , but if you need one I would recommend using a dataset instead
for some examples see the CSV series
/\/\o\/\/ PowerShelled: more Monad scripts, and a bit more CSV or /\/\o\/\/ PowerShelled: PowerShell out-DataGrid update and more ...
Enjoy,
Greetings /\/\o\/\/