Test-VMNetworkAdapter
Tests connectivity between virtual machines.
语法
Parameter Set: VMName
Test-VMNetworkAdapter [-VMName] <String> -ReceiverIPAddress <System.String> -SenderIPAddress <System.String> -SequenceNumber <System.Int32> [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <System.String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-IsolationId <Nullable [System.Int32]> ] [-Name <System.String> ] [-NextHopMacAddress <System.String> ] [-Passthru] [-Receiver] [-Sender] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: ResourceObject
Test-VMNetworkAdapter [-VMNetworkAdapter] <VMNetworkAdapter> -ReceiverIPAddress <System.String> -SenderIPAddress <System.String> -SequenceNumber <System.Int32> [-IsolationId <Nullable [System.Int32]> ] [-NextHopMacAddress <System.String> ] [-Passthru] [-Receiver] [-Sender] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMObject
Test-VMNetworkAdapter [-VM] <VirtualMachine> -ReceiverIPAddress <System.String> -SenderIPAddress <System.String> -SequenceNumber <System.Int32> [-IsolationId <Nullable [System.Int32]> ] [-Name <System.String> ] [-NextHopMacAddress <System.String> ] [-Passthru] [-Receiver] [-Sender] [-Confirm] [-WhatIf] [ <CommonParameters>]
详细说明
The Test-VMNetworkAdapter cmdlet tests connectivity between virtual machines by using Internet Control Message Protocol (ICMP) Ping packets. Ping verifies IP-level connectivity to another TCP/IP computer by sending ICMP Echo Request messages.
参数
-CimSession<Microsoft.Management.Infrastructure.CimSession[]>
在远程会话中或远程计算机上运行该 cmdlet。输入计算机名或会话对象,如 New-cimsession 或 Get-cimsession cmdlet 的输出。默认为本地计算机上的当前会话。
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-ComputerName<System.String[]>
Specifies one or more Hyper-V hosts on which this cmdlet operates. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Credential<System.Management.Automation.PSCredential[]>
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-IsolationId<Nullable [System.Int32]>
Specifies the ID of a virtual subnet.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Name<System.String>
Specifies the name of the virtual machine.
别名 |
VMNetworkAdapterName |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-NextHopMacAddress<System.String>
Specified the MAC address for the next hop VM required for non-Hyper-V Network Virtualization configurations.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Passthru
返回一个对象,该对象表示所使用的项。默认情况下,此 cmdlet 不生成任何输出。
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Receiver
Indicates that the cmdlet targets the receiver virtual machine.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-ReceiverIPAddress<System.String>
Specifies the IP address of the receiver virtual machine.
别名 |
none |
是否必需? |
true |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Sender
Indicates that the cmdlet targets the sender virtual machine.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-SenderIPAddress<System.String>
Specifies the IP address of the sender virtual machine.
别名 |
none |
是否必需? |
true |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-SequenceNumber<System.Int32>
Specifies the sequence number to use to generate ICMP Ping packets. The default value is 100.
别名 |
none |
是否必需? |
true |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-VM<VirtualMachine>
Specifies a virtual machine. The cmdlet tests connectivity for adapters that belong to the virtual machines that you specify.
别名 |
none |
是否必需? |
true |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
True (ByValue) |
是否接受通配符? |
false |
-VMName<String>
Specifies the name of a virtual machine.
别名 |
none |
是否必需? |
true |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
True (ByValue) |
是否接受通配符? |
false |
-VMNetworkAdapter<VMNetworkAdapter>
Specifies a virtual machine network adapter as a VMNetworkAdapterBase object. The cmdlet tests connectivity for the adapters that you specify. To obtain a network adapter, use the Get-VMNetworkAdapter cmdlet.
别名 |
none |
是否必需? |
true |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
True (ByValue) |
是否接受通配符? |
false |
-Confirm
在运行 cmdlet 前提示你进行确认。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-WhatIf
显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
<CommonParameters>
此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
输入
输入类型是可以传送到 cmdlet 的对象的类型。
输出
输出类型是 cmdlet 发出的对象的类型。
示例
Example 1: Test connectivity
This command tests connectivity by using the virtual network adapter named ContosoNic01. The command targets the receiver virtual machine.
PS C:\> Test-VMNetworkAdapter –VMName "ContosoVM01" –Receiver –SenderIPAddress "10.20.20.5" –ReceiverIPAddress "10.20.20.6" –VMNetworkAdapterName "ContosoNic01"