# PowerShell 1.0
$outRecord=New-Object PSObject|Add-Member noteproperty X $null -pass|Add-Member noteproperty Y $null -pass
# PowerShell 2.0
$outRecord=New-Object PSObject -Property @{X=$null;Y=$null}
# PowerShell 3.0
$outRecord=[pscustomobject]@{X=$null;Y=$null}
3つのコードはほぼ等価です。PowerShell2.0と3.0では連想配列リテラルを用いて簡単にカスタムオブジェクトを作れるようになりました。