$wmi = Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName $computer -Namespace $namespace.
使用这个 power shell 脚本如何获取参数的值?即我怎样才能得到这些的价值:
BytesReceivedPerSec
BytesSentPerSec
BytesTotalPerSec
$wmi = Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName $computer -Namespace $namespace.
使用这个 power shell 脚本如何获取参数的值?即我怎样才能得到这些的价值:
BytesReceivedPerSec
BytesSentPerSec
BytesTotalPerSec
这还不够吗?
$wmi = Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName $computer | select Name, BytesReceivedPerSec, BytesSentPerSec, BytesTotalPerSec
您还可以使用 .NET 进行统计总计:
$wmi = [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces() | foreach {$_.name; $_.GetIPv4Statistics()}
Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface -ComputerName $computer -Namespace $namespace
| Select BytesReceivedPerSec, BytesSentPerSec, BytesTotalPerSec