Created
April 16, 2023 16:44
-
-
Save loitho/4071e4fb926210a7382740665c1b68f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$counters = @("\Network Interface(*)\Bytes Total/sec","\Network Interface(*)\Packets/sec","\Network Interface(*)\Packets Received Discarded","\Network Interface(*)\Packets Received Errors","\Network Interface(*)\Packets Outbound Discarded","\Network Interface(*)\Packets Outbound Errors") | |
$timeout = new-timespan -Seconds 10 | |
$sw = [diagnostics.stopwatch]::StartNew() | |
while ($sw.elapsed -lt $timeout) | |
{ | |
get-counter -counter $counters | select -expand countersamples | select timestamp,path,instancename,cookedvalue | export-csv -append -notypeinformation "c:\misc\counters.txt" | |
start-sleep -seconds 2 | |
} | |
write-host "Finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment