Get-VMSwitch PowerShell 指令會列舉已建立的 Hyper-V 虛擬網路。 您可以將一或多個 Hyper-V 子分割指派給每個虛擬網路。 Hyper-V 虛擬化堆疊會在第一個指派給該網路的 Hyper-V 子分割區啟動時,為虛擬網路建立 Hyper-V 可延伸交換器的實例。
Get-VMSwitch Cmdlet 使用下列語法:
Get-VMSwitch [[-Name] <string>] [-SwitchType <VMSwitchType[]>] [[-ResourcePoolName] <string[]>] [-ComputerName
<string[]>] [<CommonParameters>]
Get-VMSwitch [[-Id] <Guid[]>] [-SwitchType <VMSwitchType[]>] [[-ResourcePoolName] <string[]>] [-ComputerName
<string[]>] [<CommonParameters>]
下列範例顯示來自 Get-VMSwitch Cmdlet 的輸出。
PS C:\Windows\system32> Get-VMSwitch
Name Learnable Status
Addresses
---- --------- ------
Virtual Network - 1 2048 {OK}
Virtual Network - 2 2048 {OK}