change color in html output regarding var value RRS feed

  • Question

  • Hi,

    there is a simple code for example

    $head='<style>body{font-family:Calibri;font-size:10pt;}th{background-color:black;color:white;}td{background-color:#19fff0;color:black;}h4{margin-right: 0px; margin-bottom: 0px; margin-left: 0px;}</style>'
    ConvertTo-Html -Body "
    <font color = blue><H4><B>VAR is </B></H4></font>$a
    " -Title "Test Report" -head $head | Out-File c:\temp\report.htm

    I need to add condition that if var $a is not "10"   then in the report it will be in red

    Thursday, October 26, 2017 8:52 AM

All replies