Created
April 2, 2018 16:38
-
-
Save royashbrook/ddefc527ba3f403473360beefe5288f0 to your computer and use it in GitHub Desktop.
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
$a = "server" | |
$b = "\Processor(_Total)\% Processor Time" | |
Get-Counter -com $a -cou $b -s 1 -con | %{ | |
$cv = [math]::round($_[0].CounterSamples.CookedValue) | |
Write-Progress -Activity $a ` | |
-PercentComplete $cv ` | |
-CurrentOperation "$b - $cv%" ` | |
-Status "Measuring..." | |
} | |
#or | |
$a = "server" | |
$b = "\Memory\Committed Bytes" | |
Get-Counter -com $a -cou $b -s 1 -con | %{ | |
$cv = [math]::round($_[0].CounterSamples.CookedValue/1024/1024/1024,4) | |
Write-Progress -Activity $a ` | |
-PercentComplete $cv ` | |
-CurrentOperation "$b - $cv GB" ` | |
-Status "Measuring..." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment