@@ -21,7 +21,23 @@ param(
21
21
22
22
# Whether to include verbose transport entries in the trace file.
23
23
# Defaults to false if not specified.
24
- [switch ]$IncludeTransport
24
+ [switch ]$IncludeTransport ,
25
+
26
+ # Whether to include a raw packet capture and Windows OS networking stack
27
+ # entries in the trace file.
28
+ # NOTE: Using this switch may record networking activity on the device
29
+ # beyond that which directly involves PlayFab Party, and is not recommended
30
+ # unless specifically requested for additional support.
31
+ # Defaults to false if not specified.
32
+ [switch ]$IncludePackets ,
33
+
34
+ # Sets a maximum output file size, in megabytes, for long-running traces of
35
+ # scenarios that can't be narrowed another way. A circular buffer is used,
36
+ # where only the most recent entries are kept if the output file would
37
+ # exceed the maximum.
38
+ # If not specified, this parameter defaults to 0, which does not constrain
39
+ # trace output file size.
40
+ [int ]$MaxSizeInMB
25
41
)
26
42
27
43
if (($OutputFile -ne $null ) -and ($OutputFile -ne " " ))
70
86
{
71
87
$xrnWppProvider = " "
72
88
}
73
- $providersString = @ ($playfabPartyWppProvider , $xnupWppProvider , $xrnWppProvider ) -Join " "
89
+ if ($IncludePackets )
90
+ {
91
+ Write-Warning " A packet capture was requested with this trace. The resulting output file may therefore record Internet/networking activity on this device beyond just PlayFab Party communication, such as potentially sensitive web browser or private local network connections."
92
+ Write-Host " "
93
+ Write-Host " Please close all unneeded background applications, and never store the resulting output file in an insecure location."
94
+ Write-Host " "
95
+ Write-Host " Be aware that providing the output file to Microsoft support agents may allow them visibility of such networking activities. However only the minimum information required for PlayFab Party support will be used, and no parts will ever be shared with anyone for any reason. All records will be deleted once the support issue has been resolved."
96
+ Write-Host " "
97
+ Read-Host " To abort, press Control-C. Otherwise, press 'Enter'"
98
+ $captureString = " capture=yes"
99
+ # TCP/IP
100
+ $osNetworkingProviders = " provider={2F07E2EE-15DB-40F1-90EF-9D7BA282188A} keywords=0xFFFFFFFFFFFFFFFF level=5"
101
+ # AFD
102
+ $osNetworkingProviders += " provider={E53C6823-7BB8-44BB-90DC-3F86090D48A6} keywords=0xFFFFFFFFFFFFFFFF level=5"
103
+ # BFE
104
+ $osNetworkingProviders += " provider={106B464A-8043-46B1-8CB8-E92A0CD7A560} keywords=0xFFFFFFFFFFFFFFFF level=5"
105
+ # fwpkclnt
106
+ $osNetworkingProviders += " provider={AD33fA19-F2D2-46D1-8F4C-E3C3087E45AD} keywords=0xFFFFFFFFFFFFFFFF level=5"
107
+ # fwpuclnt
108
+ $osNetworkingProviders += " provider={5A1600D2-68E5-4DE7-BCF4-1C2D215FE0FE} keywords=0xFFFFFFFFFFFFFFFF level=5"
109
+ # WFP
110
+ $osNetworkingProviders += " provider={0C478C5B-0351-41B1-8C58-4A6737DA32E3} keywords=0xFFFFFFFFFFFFFFFF level=5"
111
+ # DNS
112
+ $osNetworkingProviders += " provider={1C95126E-7EEA-49A9-A3FE-A378B03DDB4D} keywords=0xFFFFFFFFFFFFFFFF level=5"
113
+ # WS NR
114
+ $osNetworkingProviders += " provider={B923F87A-B069-42B5-BD32-35623ABA1C48} keywords=0xFFFFFFFFFFFFFFFF level=5"
115
+ }
116
+ else
117
+ {
118
+ $captureString = " capture=no"
119
+ $osNetworkingProviders = " "
120
+ }
121
+ $providersString = @ ($playfabPartyWppProvider , $xnupWppProvider , $xrnWppProvider , $osNetworkingProviders ) -Join " "
74
122
75
123
# Attempt to determine if the netsh trace start command supports the
76
124
# 'bufferSize' parameter on this system by looking for the "bufferSize=" string
85
133
$bufferSizeString = " "
86
134
}
87
135
88
- $netshStartCmd = " netsh trace start $bufferSizeString overwrite=no tracefile=`" $traceFileName `" report=disable $providersString "
136
+ # Configure the appropriate output file size limit and mode.
137
+ if (($MaxSizeInMB -ne $null ) -and ($MaxSizeInMB -gt 0 ))
138
+ {
139
+ $maxSizeString = " maxSize=$MaxSizeInMB fileMode=circular"
140
+ }
141
+ else
142
+ {
143
+ $maxSizeString = " maxSize=0 fileMode=single"
144
+ }
145
+
146
+ $netshStartCmd = " netsh trace start $bufferSizeString overwrite=no tracefile=`" $traceFileName `" $captureString report=disable $maxSizeString $providersString "
89
147
90
148
Write-Host $netshStartCmd
91
149
cmd / c $netshStartCmd
0 commit comments