Start-EtwTraceSession中的MaximumFileSize参数似乎不起作用

问题描述

我正在尝试使一些收集ETW数据的过程自动化。为此,我正在编写Powershell脚本。该脚本包含以下命令:

Start-EtwTraceSession -Name "leTestSession" -LocalFilePath "C:\Temp\traceit.etl" -FileMode Circular -MaximumFileSize 2000

但是,运行此命令会导致以下错误

New-EtwTraceSession:当前LogFileMode(0x9000002)需要MaximumFileSize。 在C:\ Windows \ system32 \ WindowsPowerShell \ v1.0 \ Modules \ EventTracingManagement \ EventTracingManagement.psm1:93 char:5

  • New-EtwTraceSession @PSBoundParameters
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo:InvalidArgument:(MSFT_EtwTraceSession:ROOT \ Microsoft ... EtwTraceSession)> [New-EtwTraceSession],CimException
    • FullyQualifiedErrorId:MI结果4,New-EtwTraceSession

当我查看(https://docs.microsoft.com/en-us/windows/win32/etw/logging-mode-constants?redirectedfrom=MSDN)时,它表明“ Circular”值似乎与0x00000002而不是0x9000002对应。我尝试通过指定-LogFileMode 0x9000002来覆盖它,但是仍然得到几乎相同的错误输出错误消息中LogFileMode的值现在为0x2)。

这里有什么我想念的吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)