Add-PefMessageSource
Add-PefMessageSource
Adds message sources to a PEF Trace Session.
Sintaxis
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>]
Descripción detallada
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.
Parámetros
-InformationAction<System.Management.Automation.ActionPreference>
Specifies how this cmdlet responds to an information event. Los valores aceptables para este parámetro son los siguientes:
-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend
Alias |
infa |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-InformationVariable<System.String>
Specifies a variable in which to store an information event message.
Alias |
iv |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
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.
Alias |
none |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
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.
Alias |
none |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
none |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-Source<Object[]>
Specifies an array of message provider names.
Alias |
Provider |
¿Requerido? |
true |
¿Posición? |
2 |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Ejemplos
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