下記のような動きになる。
# 正常に動く
[PSCustomObject]@{hoge="hogehoge"; fuga="fugafuga"}
hoge fuga
---- ----
hogehoge fugafuga
# エラー
[System.Management.Automation.PSCustomObject]@{hoge="hogehoge"; fuga="fugafuga"}
"System.Collections.Hashtable" の値を "System.Collections.Hashtable" 型から "System.Management.Automation.PSCustomObject" 型に変換できません。作成される結果のオブジェクトは確かに System.Management.Automation.PSCustomObject なのだが、なぜこういう結果になるのか分からない……。