If you want to have all the custom fields in 1 CSV file, you could do something like this
# CSV layout
#
# VM,CField1,CField2,CField3
# vm1,field11,field21,field31
# vm2,field12,field22,field32
#
$t.psobject.Properties | where{$_.Name -ne 'VM'} | %{
$_
}
foreach($row in (Import-Csv -Path input,csv -UseCulture)){
$vm = Get-VM -Name $row.VM
$row.psobject.Properties | where{$_.Name -ne 'VM'} | %{
Set-CustomField -Entity $vm -Name $_.Name -Value $_.Value
}
}