说我同意
$d = @{"foo"="bar"; "baz"=99.9}
ConvertTo-csv $d
我期待类似的东西
foo,baz
"bar",99.9
但相反,我得到了这个:
#TYPE System.Collections.Hashtable
"IsReadOnly","IsFixedSize","IsSynchronized","Keys","Values","SyncRoot","Count"
"False","False","False","System.Collections.Hashtable+KeyCollection","System.Collections.Hashtable+ValueCollection","System.Object","2"
似乎将有关对象的元数据放入 CSV,而不是对象的实际内容。
如何获得预期的结果?