我无法仅显示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 -日志安全 | 其中 {$ .EventID -eq 4800 -或 $ .EventID -eq 4801} | 格式表时间
Time
----
有任何想法吗?