Share via


Add-NetEventVmSwitch

Add-NetEventVmSwitch

Adds a Hyper-V virtual switch as a filter on a provider.

Sintaxe

Parameter Set: cim:CreateInstance0
Add-NetEventVmSwitch [-Name] <String> [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>] [ <WorkflowParameters>]

Descrição detalhada

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[]>

Executa o cmdlet em uma sessão remota ou em um computador remoto. Insira um nome do computador ou um objeto de sessão, como a saída de um cmdlet New-CimSession ou Get-CimSession. O padrão é a sessão atual do computador local.

Aliases

Session

Necessário?

false

Posição?

named

Valor padrão

none

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-Name<String>

Specifies a name for the Hyper-V virtual switch.

Aliases

none

Necessário?

true

Posição?

1

Valor padrão

none

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ThrottleLimit<Int32>

Especifica o número máximo de operações simultâneas que podem ser estabelecidas para executar o cmdlet. Se esse parâmetro for omitido ou um valor de 0 for inserido, o Windows PowerShell® calculará o limite ideal de restrição para o cmdlet com base no número de cmdlets do CIM que estão em execução no computador. O limite de restrição se aplica somente ao cmdlet atual, e não à sessão ou ao computador.

Aliases

none

Necessário?

false

Posição?

named

Valor padrão

none

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-Confirm

Solicita que você confirme antes de executar o cmdlet.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-WhatIf

Mostra o que aconteceria se o cmdlet fosse executado. O cmdlet não é executado.

Necessário?

false

Posição?

named

Valor padrão

false

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

<CommonParameters>

Esse cmdlet dá suporte a parâmetros comuns: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Para obter mais informações, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

<WorkflowParameters>

Este cmdlet dá suporte aos seguintes parâmetros comuns de fluxo de trabalho: -PSParameterCollection, -PSComputerName, -PSCredential, -PSConnectionRetryCount, -PSConnectionRetryIntervalSec, -PSRunningTimeoutSec, -PSElapsedTimeoutSec, -PSPersist, -PSAuthentication, -PSAuthenticationLevel, -PSApplicationName, -PSPort, -PSUseSSL, -PSConfigurationName, -PSConnectionURI, -PSAllowRedirection, -PSSessionOption, -PSCertificateThumbprint, -PSPrivateMetadata, -AsJob, -JobName e –InputObject. Para obter mais informações, consulte  about_WorkflowCommonParameters.

Entradas

O tipo de entrada é o tipo dos objetos que você pode canalizar para o cmdlet.

Saídas

O tipo de saída é o tipo de objeto emitido pelo cmdlet.

Exemplos

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"

Tópicos relacionados

Get-NetEventVmSwitch

Remove-NetEventVmSwitch