以默认格式获取网络适配信息

默认以表格形式显示

Get-NetAdapter

Name                      InterfaceDescription                    ifIndex Status       MacAddress             LinkSpeed
----                      --------------------                    ------- ------       ----------             ---------
WLAN                      Realtek RTL8821CE 802.11ac PCIe Adapter      12 Up           AC-D5-64-BE-15-71      72.2 Mbps
Ethernet                  Realtek PCIe GbE Family Controller            8 Up           04-0E-3C-12-9E-E4         1 Gbps

以列表形式获取网络适配信息

使用 *** | fl 以列表形式显示更多信息

Get-NetAdapter | fl


Name                       : WLAN
InterfaceDescription       : Realtek RTL8821CE 802.11ac PCIe Adapter
InterfaceIndex             : 12
MacAddress                 : AC-D5-64-BE-15-71
MediaType                  : Native 802.11
PhysicalMediaType          : Native 802.11
InterfaceOperationalStatus : Up
AdminStatus                : Up
LinkSpeed(Mbps)            : 72.2
MediaConnectionState       : Connected
ConnectorPresent           : True
DriverInformation          : Driver Date 2019-04-06 Version 2024.0.8.104 NDIS 6.70

Name                       : Ethernet
InterfaceDescription       : Realtek PCIe GbE Family Controller
InterfaceIndex             : 8
MacAddress                 : 04-0E-3C-12-9E-E4
MediaType                  : 802.3
PhysicalMediaType          : 802.3
InterfaceOperationalStatus : Up
AdminStatus                : Up
LinkSpeed(Gbps)            : 1
MediaConnectionState       : Connected
ConnectorPresent           : True
DriverInformation          : Driver Date 2015-04-09 Version 9.1.409.2015 NDIS 6.40

禁用指定网络适配器

Disable-NetAdapter -Name "Ethernet" -cf:$false

启用指定网络适配器

Enable-NetAdapter -Name "Ethernet" -cf:$false

知道更多

Get-NetAdapter | fl
“fl” 是 Format-List 的简写,同理 “ft” 是 Format-Table 的简写

Enable-NetAdapter -Name "Ethernet" -cf:$false
“-cf:$false” 是 -Confirm:$false 的简写

Enable-NetAdapter "E*0"
“E*0” 是 Ethernet0 的简写

Enable-NetAdapter -Name "*"
启用所有网络适配器

Enable-NetAdapter "*"
省略 -Name 字段标识


友情提示:本站所有文章,如无特殊说明或标注,均为何星星原创发布。与此同时,趋于近年来本站的文章内容频繁被他站盗用与机器采集,现已全局禁用网站文字内容操作,了解详情或转载文章请 点此 继续!

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注