I just wanted to share that I have created a small class that can create the XML needed for types.ps1xml and format.ps1xml directly from the code of your custom object by using attributes.
For example:
[xPSProperty(Default = true, Alias = "FullName")]
public string Name
Will result in an XML like this (sorry, the forum does not allow direct XML input so I can only show the paths inside the XML)
DefaultDisplayProperty/FullName
DefaultDisplayPropertySet/FullName
You can also generate the XML for the table view
[xPSProperty(Default = true, Sequence = 1, Alias = "FullName", ColumnWidth = 30)]
public string Name
[xPSProperty(Sequence = 2, ColumnName = "Size (K)", ColumnRightAligned = true, ColumnScript = "[int]($_.Size / 1024)")]
More examples, a detailed description and the source code is available at this address:
http://texhex.blogspot.com/2008/08/automatically-generating-powershell.html