您现在的位置是:网站首页> 编程资料编程资料
PowerShell检查网卡状态和对应的电源设置_PowerShell_
2023-05-26
355人已围观
简介 PowerShell检查网卡状态和对应的电源设置_PowerShell_
适用于Windows 8.1/Server 2012 R2操作系统。
在Windows 8.1和 Windows Server 2012 R2中引入了一些用来管理网络适配器的命令。当你想检查Wifi的连通性,比如你想弄明白为什么远程唤醒不能唤醒你的机器,此时你可能需要查看一下电源管理设置了。
看下这行代码吧:
PS> Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
WLAN Intel(R) Centrino(R) Wireless-N 1000 4 Up 74-E5-0B-8D-F3-70 72 Mbps
vEthernet (Internal Et... Hyper-V 虚拟以太网适配器 #4 15 Up 00-15-5D-02-01-08 10 Gbps
vEthernet (Broadcom Ne... Hyper-V 虚拟以太网适配器 #3 13 Disconnected DC-0E-A1-73-7B-FF 1 Gbps
vEthernet (V-Hub) Hyper-V 虚拟以太网适配器 #2 11 Up 74-E5-0B-8D-F3-70 72 Mbps
Network Bridge Microsoft Network Adapter Multiplexo... 10 Up 74-E5-0B-8D-F3-70 72 Mbps
以太网 Broadcom NetLink (TM) Gigabit Ethernet 3 Disconnected DC-0E-A1-73-7B-FF 0 bps
一旦你找到了对应的网卡名称就可以查看电源设置了。
PS> Get-NetAdapter -Name WiFi | Get-NetAdapterPowerManagement
InterfaceDescription : Intel(R) Wireless-N 7260
Name : WiFi
ArpOffload : Enabled
NSOffload : Enabled
RsnRekeyOffload : Enabled
D0PacketCoalescing : Enabled
SelectiveSuspend : Unsupported
DeviceSleepOnDisconnect : Disabled
WakeOnMagicPacket : Enabled
WakeOnPattern : Enabled
荔非苔注:我自己本机上运行后的输出为:Get-NetAdapterPowerManagement : 连到系统上的设备没有发挥作用。
相关内容
- PowerShell添加本地账户脚本分享_PowerShell_
- Powershell检查网站响应并计算执行时间例子_PowerShell_
- PowerShell中改变F1帮助文档命令获取方式为在线文档的方法_PowerShell_
- PowerShell ISE自动化简单示例_PowerShell_
- Powershell ISE的抽象语法树编程示例_PowerShell_
- 揭秘PowerShell 5.0新特性和新功能_PowerShell_
- 简单谈谈PowerShell 4.0中的新命令_PowerShell_
- PowerShell 3.0管理Hyper-V 3.0_PowerShell_
- Windows 8 中的 PowerShell 3.0_PowerShell_
- PowerShell管理Win Server 2008 R2_PowerShell_
