Get-VMNetworkAdapter
Get-VMNetworkAdapter
Gets the virtual network adapters of a virtual machine, snapshot, management operating system, or of a virtual machine and management operating system.
構文
Parameter Set: VMName
Get-VMNetworkAdapter [-VMName] <String[]> [[-Name] <String> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-IsLegacy <Boolean> ] [ <CommonParameters>]
Parameter Set: All
Get-VMNetworkAdapter [[-Name] <String> ] -All [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [ <CommonParameters>]
Parameter Set: ManagementOS
Get-VMNetworkAdapter [[-Name] <String> ] -ManagementOS [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-SwitchName <String> ] [ <CommonParameters>]
Parameter Set: VMObject
Get-VMNetworkAdapter [-VM] <VirtualMachine[]> [[-Name] <String> ] [-IsLegacy <Boolean> ] [ <CommonParameters>]
Parameter Set: VMSnapshot
Get-VMNetworkAdapter [-VMSnapshot] <VMSnapshot> [[-Name] <String> ] [ <CommonParameters>]
詳細説明
The Get-VMNetworkAdapter cmdlet gets the virtual network adapters of the specified virtual machine, snapshot, or management operating system.
パラメーター
-CimSession<Microsoft.Management.Infrastructure.CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。コンピューター名またはセッション オブジェクト (New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など) を入力します。既定値は、ローカル コンピューター上の現在のセッションです。
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-ComputerName<String[]>
Specifies one or more Hyper-V hosts on the virtual network adapters are to be retrieved. 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.
Aliases |
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.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-IsLegacy<Boolean>
Specify as $TRUE to retrieve only legacy network adapters, or as $FALSE to retrieve only Hyper-V-specific network adapters. If not specified, virtual network adapters of both types are retrieved.
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-ManagementOS
Specifies the management operating system, i.e. the virtual machine host operating system.
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-Name<String>
Specifies the name of the network adapter to be retrieved.
Aliases |
VMNetworkAdapterName |
必須/オプション |
false |
位置 |
2 |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-VM<VirtualMachine[]>
Specifies the virtual machine whose virtual network adapters are to be retrieved. . The asterisk, “*”, is the wildcard. If it is specified the cmdlet returns virtual network adapters from every virtual machine in the system.
Aliases |
none |
必須/オプション |
true |
位置 |
1 |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByValue) |
ワイルドカード文字の受け入れ |
false |
-VMName<String[]>
Specifies the name of the virtual machine whose network adapters are to be retrieved.
Aliases |
none |
必須/オプション |
true |
位置 |
1 |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByValue) |
ワイルドカード文字の受け入れ |
false |
-VMSnapshot<VMSnapshot>
Specifies the snapshot whose network adapters are to be retrieved.
Aliases |
VMCheckpoint |
必須/オプション |
true |
位置 |
1 |
既定値 |
none |
パイプライン入力の受け入れ |
True (ByValue) |
ワイルドカード文字の受け入れ |
false |
-SwitchName<String>
Specifies the name of the virtual switch whose network adapters are to be retrieved. (This parameter is available only for virtual network adapters in the management operating system.)
Aliases |
none |
必須/オプション |
false |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
-All
Specifies all virtual network adapters in the system, regardless of whether the virtual network adapter is in the management operating system or in a virtual machine.
Aliases |
none |
必須/オプション |
true |
位置 |
named |
既定値 |
none |
パイプライン入力の受け入れ |
false |
ワイルドカード文字の受け入れ |
false |
<CommonParameters>
このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
出力
出力型は、コマンドレットが出力するオブジェクトの型です。
- Microsoft.HyperV.PowerShell.VMInternalNetworkAdapter if ManagementOS is specified; Microsoft.HyperV.PowerShell.VMInternalNetworkAdapter and Microsoft.HyperV.PowerShell.VMNetworkAdapter if All is specified;Microsoft.HyperV.PowerShell.VMNetworkAdapter in all other cases.
使用例
Example 1
Gets virtual network adapters from all virtual machines on the local Hyper-V host.
PS C:\> Get-VMNetworkAdapter –VMName *
Example 2
Gets the virtual network adapters in the ManagementOS (i.e. the local Hyper-V host).
PS C:\> Get-VMNetworkAdapter -ManagementOS
Example 3
Gets virtual network adapters from all virtual machines as well as the management operating system.
PS C:\> Get-VMNetworkAdapter -All