|
| 1 | +--- |
| 2 | +description: The Add-NetEventVmSwitchProvider cmdlet creates a virtual machine switch provider for network events. |
| 3 | +external help file: MSFT_NetEventVmSwitchProvider.cdxml-help.xml |
| 4 | +Module Name: NetEventPacketCapture |
| 5 | +ms.date: 10/22/2021 |
| 6 | +online version: https://docs.microsoft.com/powershell/module/neteventpacketcapture/add-neteventvmswitchprovider?view=windowsserver2022-ps&wt.mc_id=ps-gethelp |
| 7 | +schema: 2.0.0 |
| 8 | +title: Add-NetEventVmSwitchProvider |
| 9 | +--- |
| 10 | + |
| 11 | +# Add-NetEventVmSwitchProvider |
| 12 | + |
| 13 | +## SYNOPSIS |
| 14 | +Creates a virtual machine switch provider for network events. |
| 15 | + |
| 16 | +## SYNTAX |
| 17 | + |
| 18 | +``` |
| 19 | +Add-NetEventVmSwitchProvider [-SessionName] <String> [[-Level] <Byte>] [[-MatchAllKeywords] <UInt64>] |
| 20 | + [[-MatchAnyKeyword] <UInt64>] [[-SwitchName] <String>] [[-PortIds] <UInt32[]>] [-CimSession <CimSession[]>] |
| 21 | + [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>] |
| 22 | +``` |
| 23 | + |
| 24 | +## DESCRIPTION |
| 25 | +The **Add-NetEventVmSwitchProvider** cmdlet creates a virtual machine switch provider for network events. |
| 26 | + |
| 27 | +## EXAMPLES |
| 28 | + |
| 29 | +### Example 1: Add a virtual machine switch provider |
| 30 | +```powershell |
| 31 | +New-NetEventSession -Name "Session01" |
| 32 | +Add-NetEventVMSwitch -Name "Network Adapter 2 - Virtual Switch" |
| 33 | +Add-NetEventVmSwitchProvider -SessionName "Session01" -SwitchName "Network Adapter 2 - Virtual Switch" |
| 34 | +``` |
| 35 | + |
| 36 | +The first command creates a network event session named `Session01` by using the **New-NetEventSession** cmdlet. |
| 37 | + |
| 38 | +The second command creates a virtual machine switch by using the **Add-NetEventVMSwitch** cmdlet. |
| 39 | + |
| 40 | +The third command creates a virtual machine switch provider for the specified switch. |
| 41 | + |
| 42 | +## PARAMETERS |
| 43 | + |
| 44 | +### -AsJob |
| 45 | +Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. |
| 46 | + |
| 47 | +```yaml |
| 48 | +Type: SwitchParameter |
| 49 | +Parameter Sets: (All) |
| 50 | +Aliases: |
| 51 | + |
| 52 | +Required: False |
| 53 | +Position: Named |
| 54 | +Default value: None |
| 55 | +Accept pipeline input: False |
| 56 | +Accept wildcard characters: False |
| 57 | +``` |
| 58 | +
|
| 59 | +### -CimSession |
| 60 | +Runs the cmdlet in a remote session or on a remote computer. |
| 61 | +Enter a computer name or a session object, such as the output of a [New-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227967) or [Get-CimSession](https://go.microsoft.com/fwlink/p/?LinkId=227966) cmdlet. |
| 62 | +The default is the current session on the local computer. |
| 63 | +
|
| 64 | +```yaml |
| 65 | +Type: CimSession[] |
| 66 | +Parameter Sets: (All) |
| 67 | +Aliases: Session |
| 68 | + |
| 69 | +Required: False |
| 70 | +Position: Named |
| 71 | +Default value: None |
| 72 | +Accept pipeline input: False |
| 73 | +Accept wildcard characters: False |
| 74 | +``` |
| 75 | +
|
| 76 | +### -Level |
| 77 | +Specifies the level of Event Tracing for Windows (ETW) events for the provider. |
| 78 | +Use the level of detail for the event to filter the events that are logged. |
| 79 | +The default value for this parameter is 0x4. |
| 80 | +The acceptable values for this parameter are: |
| 81 | +
|
| 82 | +- 0x5. |
| 83 | +Verbose |
| 84 | +- 0x4. |
| 85 | +Informational |
| 86 | +- 0x3. |
| 87 | +Warning |
| 88 | +- 0x2. |
| 89 | +Error |
| 90 | +- 0x1. |
| 91 | +Critical |
| 92 | +- 0x0. |
| 93 | +LogAlways |
| 94 | +
|
| 95 | +The provider must log the event if the value of the event is less than or equal to the value of this parameter. |
| 96 | +
|
| 97 | +```yaml |
| 98 | +Type: Byte |
| 99 | +Parameter Sets: (All) |
| 100 | +Aliases: |
| 101 | + |
| 102 | +Required: False |
| 103 | +Position: 1 |
| 104 | +Default value: None |
| 105 | +Accept pipeline input: False |
| 106 | +Accept wildcard characters: False |
| 107 | +``` |
| 108 | +
|
| 109 | +### -MatchAllKeywords |
| 110 | +Specifies a bitmask that restricts the events that the provider logs. |
| 111 | +
|
| 112 | +```yaml |
| 113 | +Type: UInt64 |
| 114 | +Parameter Sets: (All) |
| 115 | +Aliases: |
| 116 | + |
| 117 | +Required: False |
| 118 | +Position: 3 |
| 119 | +Default value: None |
| 120 | +Accept pipeline input: False |
| 121 | +Accept wildcard characters: False |
| 122 | +``` |
| 123 | +
|
| 124 | +### -MatchAnyKeyword |
| 125 | +Specifies keywords as a set of hexadecimal values. |
| 126 | +Keywords are flags that you can combine to generate values. |
| 127 | +Use a set of hexadecimal values of the keywords instead of the keyword names, and apply a filter to write ETW events for keyword matches. |
| 128 | +
|
| 129 | +```yaml |
| 130 | +Type: UInt64 |
| 131 | +Parameter Sets: (All) |
| 132 | +Aliases: |
| 133 | + |
| 134 | +Required: False |
| 135 | +Position: 2 |
| 136 | +Default value: None |
| 137 | +Accept pipeline input: False |
| 138 | +Accept wildcard characters: False |
| 139 | +``` |
| 140 | +
|
| 141 | +### -PortIds |
| 142 | +Specifies port numbers. |
| 143 | +
|
| 144 | +```yaml |
| 145 | +Type: UInt32[] |
| 146 | +Parameter Sets: (All) |
| 147 | +Aliases: |
| 148 | + |
| 149 | +Required: False |
| 150 | +Position: 5 |
| 151 | +Default value: None |
| 152 | +Accept pipeline input: False |
| 153 | +Accept wildcard characters: False |
| 154 | +``` |
| 155 | +
|
| 156 | +### -SessionName |
| 157 | +Specifies the name of the session that is associated with the **NetEventVMSwitchProvider**. |
| 158 | +This parameter has the same value as the **Name** parameter for the **New-NetEventSession** cmdlet. |
| 159 | +
|
| 160 | +```yaml |
| 161 | +Type: String |
| 162 | +Parameter Sets: (All) |
| 163 | +Aliases: |
| 164 | + |
| 165 | +Required: True |
| 166 | +Position: 0 |
| 167 | +Default value: None |
| 168 | +Accept pipeline input: False |
| 169 | +Accept wildcard characters: False |
| 170 | +``` |
| 171 | +
|
| 172 | +### -SwitchName |
| 173 | +Specifies the switch for this virtual machine switch provider. |
| 174 | +
|
| 175 | +```yaml |
| 176 | +Type: String |
| 177 | +Parameter Sets: (All) |
| 178 | +Aliases: |
| 179 | + |
| 180 | +Required: False |
| 181 | +Position: 4 |
| 182 | +Default value: None |
| 183 | +Accept pipeline input: False |
| 184 | +Accept wildcard characters: False |
| 185 | +``` |
| 186 | +
|
| 187 | +### -ThrottleLimit |
| 188 | +Specifies the maximum number of concurrent operations that can be established to run the cmdlet. |
| 189 | +If this parameter is omitted or a value of `0` is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. |
| 190 | +The throttle limit applies only to the current cmdlet, not to the session or to the computer. |
| 191 | + |
| 192 | +```yaml |
| 193 | +Type: Int32 |
| 194 | +Parameter Sets: (All) |
| 195 | +Aliases: |
| 196 | +
|
| 197 | +Required: False |
| 198 | +Position: Named |
| 199 | +Default value: None |
| 200 | +Accept pipeline input: False |
| 201 | +Accept wildcard characters: False |
| 202 | +``` |
| 203 | + |
| 204 | +### -Confirm |
| 205 | +Prompts you for confirmation before running the cmdlet. |
| 206 | + |
| 207 | +```yaml |
| 208 | +Type: SwitchParameter |
| 209 | +Parameter Sets: (All) |
| 210 | +Aliases: cf |
| 211 | +
|
| 212 | +Required: False |
| 213 | +Position: Named |
| 214 | +Default value: None |
| 215 | +Accept pipeline input: False |
| 216 | +Accept wildcard characters: False |
| 217 | +``` |
| 218 | + |
| 219 | +### -WhatIf |
| 220 | +Shows what would happen if the cmdlet runs. |
| 221 | +The cmdlet is not run. |
| 222 | + |
| 223 | +```yaml |
| 224 | +Type: SwitchParameter |
| 225 | +Parameter Sets: (All) |
| 226 | +Aliases: wi |
| 227 | +
|
| 228 | +Required: False |
| 229 | +Position: Named |
| 230 | +Default value: None |
| 231 | +Accept pipeline input: False |
| 232 | +Accept wildcard characters: False |
| 233 | +``` |
| 234 | + |
| 235 | +### CommonParameters |
| 236 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). |
| 237 | + |
| 238 | +## INPUTS |
| 239 | + |
| 240 | +### None |
| 241 | + |
| 242 | +## OUTPUTS |
| 243 | + |
| 244 | +### System.Object |
| 245 | +## NOTES |
| 246 | + |
| 247 | +## RELATED LINKS |
| 248 | + |
| 249 | +[Add-NetEventVMSwitch](Add-NetEventVMSwitch.md) |
| 250 | + |
| 251 | +[Get-NetEventVmSwitchProvider](Get-NetEventVmSwitchProvider.md) |
| 252 | + |
| 253 | +[New-NetEventSession](New-NetEventSession.md) |
| 254 | + |
| 255 | +[Remove-NetEventVmSwitchProvider](Remove-NetEventVmSwitchProvider.md) |
| 256 | + |
| 257 | +[Set-NetEventVmSwitchProvider](Set-NetEventVmSwitchProvider.md) |
0 commit comments