Is this a powershell bug? It will only print $var1, not $var2 inside a script (I can't pipe it to where-object either). But when I copy and paste it to the command line it works fine.
$var1 = New-Object -TypeName PSObject -Prop @{'data1'=6}
write-output $var1
$var2 = New-Object -TypeName PSObject -Prop @{'data2'=12}
write-output $var2
data1
------
6
EDIT: I think I'm starting to get it. Here's a weirder example. You can only output or process common fields from the second object:
$var1 = New-Object PSObject -prop @{data1=6;data3=5}
$var1
$var2 = New-Object PSObject -prop @{data2=12;data3=6}
$var2
data1 data3
----- -----
6 5
6
EDIT2: this has to do with the implied running of format-table, and how it sets up columns.