Here's one way to do it -- Don't use PSCustomObjects until you need them. Use an ordered hash and use them to create the PSCustomObjects when you need them.
# invalid hash
$o1 = [ordered]@{
MatchFound = "True"
InvalidAddress = "True"
}
#valid hash
$o2 = [ordered]@{
FirstName = "Bill"
Surname = "Jones"
C3 = "cp"
XX50 = "xxp"
}
[PSCustomObject]$o2 | Export-Csv c:\junk\valid.csv -NoTypeInformation
$o3 = [ordered]@{}
$o1, $o2 |
ForEach-Object{
$_.GetEnumerator() |
ForEach-Object{
$o3[$_.Key] = $_.Value
}
}
[PSCustomObject]$o3 | Export-Csv c:\junk\invalid.csv -NoTypeInformation