Add-NetEventVmSwitch
Add-NetEventVmSwitch
Adds a Hyper-V virtual switch as a filter on a provider.
Sintaxis
Parameter Set: cim:CreateInstance0
Add-NetEventVmSwitch [-Name] <String> [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]
Descripción detallada
The Add-NetEventVmSwitch cmdlet adds a Hyper-V virtual switch as a filter on a Remote Packet Capture provider. Use this cmdlet multiple times to add multiple Hyper-V virtual switches. To get existing Hyper-V virtual switches, use the Get-NetEventVmSwitch cmdlet.
The protocol stack uses multiple layers to transmit, receive, and process network traffic as packets. The provider logs network traffic as Event Tracing for Windows (ETW) events.
Parámetros
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Name<String>
Specifies a name for the Hyper-V virtual switch.
Alias |
none |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
none |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
none |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
none |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿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).
<WorkflowParameters>
Este cmdlet admite los siguientes parámetros comunes de flujos de trabajo: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName e –InputObject. Para obtener más información, consulte about_WorkflowCommonParameters.
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 Hyper-V virtual switch on a provider
This example adds a Hyper-V virtual switch as a filter on the Remote Packet Capture provider for a network session. After you complete these commands to configure the network session, you can start and stop the event and packet capture for the network session by using the Start-NetEventSession and Stop-NetEventSession cmdlets.
The first command uses the New-NetEventSession cmdlet to create a network session named NESession01.
The second command uses the Add-NetEventPacketCaptureProvider cmdlet to add a Remote Packet Capture provider for the session named NESession01.
The third command adds a Hyper-V virtual switch as a filter on the Remote Packet Capture provider.
PS C:\> New-NetEventSession -Name "NESession01"
PS C:\> Add-NetEventPacketCaptureProvider -SessionName "NESession01"
PS C:\> Add-NetEventVMSwitch -Name “Network Adapter 2 - Virtual Switch"