Last active
December 17, 2015 04:19
-
-
Save aroben/5550040 to your computer and use it in GitHub Desktop.
Script to measure network usage on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LastLine = "" | |
while ($true) { | |
$Bps = Get-WMIObject -Class Win32_PerfFormattedData_Tcpip_NetworkInterface ` | |
| Measure-Object BytesTotalPersec -Sum | %{ $_.Sum } | |
$ThisLine = "{0:F2} KiB/sec" -f ($Bps / 1024) | |
[Console]::Write("`r{0}" -f (" " * $LastLine.Length)) | |
[Console]::Write("`r$ThisLine") | |
$LastLine = $ThisLine | |
Start-Sleep -Seconds 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment