gpt4 book ai didi

windows - 获取 Windows 计算机网卡速度的 PowerShell 脚本

转载 作者:可可西里 更新时间:2023-11-01 13:06:41 25 4
gpt4 key购买 nike

获取特定 Windows 机器网卡运行速度的 PowerShell 脚本是什么?

我知道这可以通过基于 WMI 查询的语句来完成,一旦我解决了就会发布答案。

最佳答案

一个基本的命令是

Get-WmiObject -ComputerName 'servername' -Class Win32_NetworkAdapter | `
Where-Object { $_.Speed -ne $null -and $_.MACAddress -ne $null } | `
Format-Table -Property SystemName,Name,NetConnectionID,Speed

请注意,ComputerName 参数采用一个数组,因此您可以在多台计算机上运行它,前提是您有权限。将 Format-Table 属性列表替换为 ***** 以获得更全面的可用属性列表。您可能希望过滤这些属性以删除您不感兴趣的条目。

使用内置的字节乘数后缀(MB、GB 等)还可以根据您的需要提高速度的可读性。您可以将其指定为 Format-Table -Property 数组中的 HashTable 条目,例如

Format-Table -Property NetConnectionID,@{Label='Speed(GB)'; Expression = {$_.Speed/1GB}}

关于windows - 获取 Windows 计算机网卡速度的 PowerShell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3002473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com