【发布时间】:2013-03-14 20:26:13
【问题描述】:
我无法仅显示命令的 Time 列。
Get-EventLog -log Security | where {$_.EventID -eq 4800 -or $_.EventID -eq 4801}
返回:
Index Time EntryType Source InstanceID Message
----- ---- --------- ------ ---------- -------
167513 Mar 14 10:31 SuccessA... Microsoft-Windows... 4801 The workstation was unlocked....
167506 Mar 14 10:14 SuccessA... Microsoft-Windows... 4800 The workstation was locked....
167499 Mar 14 10:08 SuccessA... Microsoft-Windows... 4801 The workstation was unlocked....
但是,如果我只想查看Time 列,我什么也得不到:
Get-EventLog -log 安全性 |其中 {$.EventID -eq 4800 -或 $.EventID -eq 4801} |格式表时间
Time
----
有什么想法吗?
【问题讨论】:
标签: powershell powershell-cmdlet