我有一个数组,它将用户的登录信息保存为对象。这是该数组的打印:
PS> $Write-Out $data1
System.Object System.Object System.Object System.Object System.Object System.Object System.Object
PS> $data1
ComputerName User Time Action
------------ ---- ------------------- ------
DC1 usr1 05/06/2013 11:51:35 logoff
DC1 usr1 05/06/2013 11:46:24 logon
DC1 usr1 05/06/2013 11:42:05 logoff
DC2 usr2 05/06/2013 11:44:08 logon
DC2 Administrator 05/06/2013 11:43:50 logoff
DC2 Administrator 05/06/2013 11:42:53 logon
DC2 Administrator 05/06/2013 11:40:27 logoff
我想转换这个数组,这样我就可以在同一行看到登录和注销时间,如下所示:
PS> $data2
ComputerName User Time LOGON Time LOGOFF
------------ ---- ------------------- -------------------
DC1 usr1 05/06/2013 11:46:24 05/06/2013 11:51:35
DC1 usr1 05/06/2013 11:42:05
DC2 usr2 05/06/2013 11:44:08
DC2 Administrator 05/06/2013 11:42:53 05/06/2013 11:43:50
DC2 Administrator 05/06/2013 11:40:27
您能帮我将 $data1 数组转换为 $data2 数组吗?