Add-PefMessageSource
Add-PefMessageSource
Adds message sources to a PEF Trace Session.
Syntax
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>]
Detaillierte Beschreibung
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.
Parameter
-InformationAction<System.Management.Automation.ActionPreference>
Specifies how this cmdlet responds to an information event. Die folgenden Werte für diesen Parameter sind zulässig:
-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend
Aliasse |
infa |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-InformationVariable<System.String>
Specifies a variable in which to store an information event message.
Aliasse |
iv |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliasse |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliasse |
none |
Erforderlich? |
true |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
True (ByValue) |
Platzhalterzeichen akzeptieren? |
false |
-Source<Object[]>
Specifies an array of message provider names.
Aliasse |
Provider |
Erforderlich? |
true |
Position? |
2 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Eingaben
Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
Beispiele
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