Add-PefProviderConfig
Add-PefProviderConfig
Adds a provider to a remote Trace Session on a target host.
구문
Parameter Set: Default
Add-PefProviderConfig [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-Provider <String> ] [-TargetHost <PefTargetHost> ] [ <CommonParameters>]
자세한 설명
The Add-PefProviderConfig cmdlet adds a provider to the remote session configured by using a friendly name. Do not specify a GUID.
You access provider configuration by using the object that this cmdlet creates. You can configure provider error levels, event keywords, and other provider-specific options for providers such as the Microsoft-Windows-NDIS-PacketCapture, Microsoft-Pef-WebProxy, and Microsoft-Pef-WPF. Use this object as input for the Add-PefMessageSource cmdlet.
매개 변수
-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 |
-Provider<String>
Specifies the friendly name for a message provider.
별칭 |
none |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 적용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-TargetHost<PefTargetHost>
Specifies a target host object that represents a remote computer that you configure for a remote Live Trace Session. To obtain a target host object, use the New-PefTargetHost cmdlet.
별칭 |
none |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 적용 여부 |
True (ByValue) |
와일드카드 문자 허용 여부 |
false |
<CommonParameters>
이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).
입력
입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.
출력
출력 유형은 cmdlet이 내보내는 개체의 유형입니다.
예제
Example 1: Create and configure a remote trace to a named server
The first command creates a target host for the computer named Server07, by using the New-PefTargetHost cmdlet, and then stores that host in the $targetHost variable.
The second command passes the host stored in $targetHost to the current cmdlet, by using the pipeline operator. This cmdlet adds a provider, and then stores the result in the $th1p1Config variable.
The third, fourth, and fifth commands use standard dot notation to refer to elements of the configuration stored in $th1p1Config, and assign values to those elements. These commands set the truncation level to 128, disables all interfaces, and then re-enables node 3. The re-enabled node might contain multiple child nodes. These nodes are enabled subsequently.
The final command creates a session, adds the target host as the session source, and starts the trace session, by using the New-PefTraceSession, Add-PefMessageSource, and Start-PefTraceSession cmdlets. The final command stores the new session in the $TraceSession01 variable. This session encapsulates the configuration settings of up in the previous commands in this example.
PS C:\> $targetHost = New-PefTargetHost -ComputerName "Server07"
PS C:\> $th1p1Config = $targetHost | Add-PefProviderConfig -Provider "Microsoft-Windows-NDIS-PacketCapture"
PS C:\> $th1p1Config.Configurations[0].TruncationLength = 128
PS C:\> $th1p1Config.Configurations[0].Interfaces[0].Enabled=0
PS C:\> $th1p1Config.Configurations[0].Interfaces[3].Enabled=1
PS C:\> $TraceSession01 = New-PefTraceSession -Force -Path "C:\Trace01" -SaveOnStop | Add-PefMessageSource -Source $targetHost | Start-PefTraceSession