Created
February 27, 2014 14:57
-
-
Save martin9700/9251658 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
$Data = @" | |
"Server","Path","CookedValue" | |
"dc","\\dc\\memory\available mbytes","1377" | |
"dc2","\\dc2\\memory\available mbytes","70" | |
"dc2","\\dc2\\processor(_total)\% processor time","0.00190904948765835" | |
"dc","\\dc\\processor(_total)\% processor time","0.000565369831695417" | |
"dc2","\\dc2\\system\processor queue length","0" | |
"dc2","\\dc2\\processor(_total)\% privileged time","0" | |
"dc2","\\dc2\\memory\pages/sec","0" | |
"dc","\\dc\\memory\pages/sec","0" | |
"dc","\\dc\\processor(_total)\% privileged time","0" | |
"dc","\\dc\\system\processor queue length","0" | |
"@ | |
$Data = $Data | ConvertFrom-Csv | |
$Header = @" | |
<style> | |
TABLE {border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;} | |
TH {border-width: 1px;padding: 3px;border-style: solid;border-color: black;background-color: #6495ED;} | |
TD {border-width: 1px;padding: 3px;border-style: solid;border-color: black;} | |
</style> | |
"@ | |
$HTML = $Data | sort server | ConvertTo-html -head $header | Set-CellColor -Property cookedvalue -Color red -Filter "cookedvalue -gt 90" | |
$HTML = $HTML | Set-CellColor Server green -Filter "server -eq 'dc2'" | |
$HTML | Set-CellColor Path Yellow -Filter "Path -like ""*memory*""" | Out-File c:\Test\colortest.html | |
& c:\Test\colortest.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment