powershell - 如何从事件日志中仅检索事件消息?

标签 powershell

根据示例,使用:

Get-EventLog system -newest 5 -After 09202016 -Message "Something",

我认为“某事”可能是我正在寻找的消息类型。

虽然我没有得到任何匹配:

Get-EventLog : No matches found
At line:1 char:13
+ Get-EventLog <<<<  system -newest 5 -After  09202016 -Message The
    + CategoryInfo          : ObjectNotFound: (:) [Get-EventLog], ArgumentException
    + FullyQualifiedErrorId : GetEventLogNoEntriesFound,Microsoft.PowerShell.Commands.GetEventLogCommand

最佳答案

您可能想使用通配符:

Get-EventLog system -newest 5 -After 09202016 -Message "*Something*"

关于powershell - 如何从事件日志中仅检索事件消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39733797/

相关文章:

powershell - PowerShell 中的 ParameterSetName 检测是否匹配 ValueFromPipeline 输入对象类型?

excel - Powershell 中的 VLOOKUP 脚本

powershell - 输出和简单的算法问题面向对象

powershell - 如何在 PowerShell 中检索 IIS 网站的 SSL 证书

git - 如何在右键单击时打开 Github for Windows 的 Git Shell?

powershell - 使用ValidateSet()和ValidatePattern()允许新值?

powershell将哈希表数组转换为csv

powershell - 如何创建资源级别变量

.net - PowerShell-为什么不捕获 "Divide By Zero Exception"?

.net - 如何在powershell中为文件列表设置颜色