PowerShell 3.0 为我们提供了 PSCustomObject 作为允许正确表格格式的类型,如下所示:
> [PSCustomObject]@{ Day = "Monday"; Task = "Wash car" }
Day Task
--- ----
Monday Wash car
但是如果我通过一个变量,它会恢复到愚蠢的模式。
> [PSCustomObject]$row = @{ Day = "Monday"; Task = "Wash car" }
> $row
Name Value
--- ----
Task Wash car
Day Monday
为什么?(谢谢)