Add-PefMessageSource
Add-PefMessageSource
Adds message sources to a PEF Trace Session.
構文
Parameter Set: Default
Add-PefMessageSource [-PEFSession] <IPpkTraceSession> [-Source] <Object[]> [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-LogConfiguration <String> ] [ <CommonParameters>]
詳細説明
The Add-PefMessageSource cmdlet adds message sources to a Trace Session. You can specify a file containing message data as a source or use Event Tracing for Windows (ETW) providers for a Protocol Engineering Framework (PEF) Live Trace Session.
パラメーター
-InformationAction<System.Management.Automation.ActionPreference>
Specifies how this cmdlet responds to an information event. このパラメーターに対して使用できる値:
-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend
エイリアス |
infa |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-InformationVariable<System.String>
Specifies a variable in which to store an information event message.
エイリアス |
iv |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-LogConfiguration<String>
Specifies the text log configuration file to use to parse the source data. Specify this parameter if you use text log files as a message source.
エイリアス |
none |
必須? |
false |
位置は? |
named |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PEFSession<IPpkTraceSession>
Specifies an object that contains a Trace Session. To create a Trace Session, use the New-PefTraceSession cmdlet. This cmdlet adds message sources to the session object that this parameter specifies.
エイリアス |
none |
必須? |
true |
位置は? |
1 |
既定値 |
none |
パイプライン入力を許可する |
True (ByValue) |
ワイルドカード文字を許可する |
false |
-Source<Object[]>
Specifies an array of message provider names.
エイリアス |
Provider |
必須? |
true |
位置は? |
2 |
既定値 |
none |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
例
Example 1: Add a trace file as a message source for a Trace Session
The first command creates a PEF Trace Session object, and then stores it in the $TraceSession01 variable.
The second command adds a saved Microsoft Network Monitor capture file (.cap) as the message source for the Trace Session stored in the $TraceSession01 variable.
The final command starts the Trace Session stored in the $TraceSession01 variable.
C:\PS> $TraceSession01 = New-PefTraceSession
C:\PS> Add-PefMessageSource -PEFSession $TraceSession01 -Source "C:\Captures\UDP10k.cap"
C:\PS> Start-PefTraceSession -PEFSession $TraceSession01
Example 2: Add a PEF message provider to a Trace Session
The first command creates a PEF Trace Session object, and then stores it in the $TraceSession01 variable.
The second command adds the Microsoft-Pef-WFP-MessageProvider as the provider for the Trace Session object stored in the $TraceSession01 variable.
The final command starts the Trace Session stored in the $TraceSession01 variable.
C:\PS> $TraceSession01 = New-PefTraceSession
C:\PS> Add-PefMessageSource -PEFSession $TraceSession01 -Source "Microsoft-Pef-WFP-MessageProvider"
C:\PS> Start-PefTraceSession -PEFSession $TraceSession01
Example 3: Add a manifest-based ETW provider to a Trace Session
The first command creates a PEF Trace Session object, and then stores it in the $TraceSession01 variable.
The second command adds the Microsoft-Windows-Dhcp-Client system ETW provider to the Trace Session object stored in the $TraceSession01 variable.
The final command starts the Trace Session stored in the $TraceSession01 variable.
C:\PS> $TraceSession01 = New-PefTraceSession
C:\PS> Add-PefMessageSource -PEFSession $TraceSession01 -Source "Microsoft-Windows-Dhcp-Client"
C:\PS> Start-PefTraceSession -PEFSession $TraceSession01
Example 4: Add a text log file as a message source for a Live Trace Session
The first command creates a PEF Trace Session object, and then stores it in the $TraceSession01 variable.
The second command adds a saved IIS text log as the message source for the Trace Session stored in $TraceSession01 and uses the LogConfig parameter to specify the configuration file that is required to parse the log.
The final command starts the Trace Session stored in $TraceSession01.
C:\PS> $TraceSession01 = New-PefTraceSession
C:\PS> Add-PefMessageSource -PEFSession $TraceSession01 -Provider "C:\Captures\IIS.log" -LogConfig IIS
C:\PS> Start-PefTraceSession -PEFSession $TraceSession01