一个简单的问题,但是如何在下面的代码中选择特定的列?
我只想显示 TIME 列,仅此而已。我尝试输入 FORMAT_TABLE TIME 但它只是多次填充 TIME 而没有实际显示时间..
$server_event = Get-Content -Path "c:\Temp\Servers.txt"
foreach($servers in $server_event)
{
$event = Get-EventLog -computerName $servers -logname system | Where-Object {$_.EventID -eq 6009} | Select -First 1
$event
}
结果:我只想显示时间列
Index Time EntryType Source InstanceID Message
----- ---- --------- ------ ---------- -------
78858 Jun 01 07:19 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
46221 Jun 01 07:20 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
214480 Jun 01 07:46 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
461238 Jun 01 07:18 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
70889 Jun 01 07:17 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
52397 Jun 01 07:19 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Multiprocessor Free.
42219 Jun 01 07:40 Information EventLog 2147489657 Microsoft (R) Windows (R) 5.02. 3790 Service Pack 2 Uniprocessor Free.