Powershell:从Get-WinEvent返回的结果中删除信息

时间:2014-10-17 18:42:54

标签: string powershell

运行以下

Get-WinEvent -ComputerName $env:ComputerName -LogName Application | Where {$_.ID -eq 63} | Select-Object -Unique

结果如下

ProviderName: Outlook

TimeCreated                     Id LevelDisplayName Message                                                                                                                                 
-----------                     -- ---------------- -------                                                                                                                                 
10/17/2014 10:09:04 AM          63 Information      The Exchange web service request GetAppManifests succeeded. 

如何删除或删除以下内容

ProviderName: Outlook

TimeCreated                     Id LevelDisplayName Message                                                                                                                                 
-----------                     -- ---------------- -------  

所以我刚刚离开

10/17/2014 10:09:04 AM          63 Information      The Exchange web service request GetAppManifests succeeded.                                                                                                               

1 个答案:

答案 0 :(得分:1)

将输出传输到Format-Table:

Get-WinEvent -ComputerName $env:ComputerName -LogName Application `
    | Where {$_.ID -eq 63} | Select-Object -Unique `
    | Format-Table -HideTableHeaders

如果要将输出转换为字符串,可以进一步管道到Out-String