Powershell HTML format change


i trying change html format , need assistance powershell export:

server , status need royal blue 3 (#2554c7) while  normal items #5cb3ff. when there failure variable , status turn run.

#export html
$icmpresults | convertto-html -head $a -body $b -property server,status |
     foreach { if ($_ -like "*<td>online</td>*" )
                      {$_ -replace "<tr>","<tr bgcolor=#5cb3ff>" }
                    else {$_ -replace "<tr>","<tr bgcolor=red>"}} |
                        out-file c:\inetpub\wwwroot\gen\icmphosts.htm   

any suggestions appreciated. trying create web based monitoring system powershell far works pretty need iron out kinks.

few days have uploaded script on technet gallery generate html report. below link same.

http://gallery.technet.microsoft.com/retrieve-sql-server-9d99aa2d

just go through script. may idea how generate formated html output.

hope helps...!!!


thanks & regards
bhavik solanki

please click “mark answer” if post answers question , click "vote helpful if post helps you.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file