Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

HTML output

$
0
0

Hi I have a script that displays the power supply status

Dn OperState Perf Thermal Voltage
sys/chassis-1/psu-1 operable ok ok ok
sys/chassis-1/psu-2 operable ok ok ok
sys/chassis-1/psu-3 operable ok ok ok
sys/chassis-1/psu-4 operable ok ok ok
sys/chassis-2/psu-1 operable ok ok ok
sys/chassis-2/psu-2 operable ok ok ok
sys/chassis-2/psu-3 operable ok ok ok

Here is the code. How do I modify this code so the html displays green color for "ok" status. Any other status display red?

Add-Content $report @'
<a name="ChassisandFabricInterconnectPowerSupplyStatus" />
<H2>Chassis and Fabric Interconnect Power Supply Status</H2>
'@

Get-UcsPsu -Ucs $handleArray | Sort-Object -Property Ucs,Dn | Select-Object Dn,OperState,Perf,Thermal,Voltage | ConvertTo-Html -Fragment | Out-File ucspsus.html
Get-Content ucspsus.html | Add-Content $report


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>