Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Question Reg HTML Output

$
0
0

Hi Experts.

My actual question was answered in the below post and very well explained.
http://powershell.com/cs/forums/t/12627.aspx

But the requirement what i have is bit different.

$Style = "<style>"
$Style = $Style + "BODY{background-color:#D7D8D8;}"
$Style = $Style + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$Style = $Style + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
$Style = $Style + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;}"
$Style = $Style + "</style>"
$ServerList = "localhost"
$serviceList =  &{$args} "Vds","bits"

$body = gwmi win32_process -cn $_ | ? {$_.name -eq "certainproces.exe"} select __Server,Name,@{n='Memory(Gb)';e={"{0:n0}" -f ($_.ws/1gb)}} | ConvertTo-Html -Fragment}

I want to color red if the output of this is more than 20Gb  anything less than that should be in green color.



Viewing all articles
Browse latest Browse all 10624

Trending Articles