【发布时间】:2011-09-20 12:32:08
【问题描述】:
我已经使用 PowerShell 编写了自定义事件日志“MyTestLog”、用于显示事件的自定义事件视图以及针对“MyTestLog”中的事件触发的一些计划作业。但是,我必须为每个要计划的作业手动对 MyTestLog 进行 XML 查询,因为 MyTestLog 不会显示在任务计划程序、应用程序、系统事件等的下拉菜单中。换句话说,我不得不使用这个 xquery 作为触发器:
<QueryList>
<Query Id="0" Path="Application">
<Select Path="MyTestLog">*[System[Provider[@Name='MyTestLog'] and (Level=1 or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]</Select>
</Query>
</QueryList>
这对我来说绝对是非常乏味的;有没有办法在下拉列表中显示 MyTestLog(在事件查看器和任务调度程序中)?
【问题讨论】:
标签: windows powershell event-handling scheduled-tasks