I have created a script that will put a collection into a html table and send it in an eamil. I would like to add an alternating color for each table row in the html table. I am building the table and each row by looping through a collection and have added $LoopCount++ count each time the loop is started. I want to use the $LoopCount++ to generate a number and based on the number being odd or even i will update the <tr "bgcolor='7FA96F'"> tag. I am not married to this method but it was the only way i could think of to get alternating colors. I am missing the logic to find out if the loopcount is an odd or even number. Any ideas would help...
FOREACH($Item in $SortedMBXProps)
{
$LoopCount ++
## Change to color 1
IF($LoopCount -eq "True")
{
$list += "<tr bgcolor='7FA96F'>"
}
## Change to color 2
ELSE
{
$list += "<tr bgcolor='FFFFFF'>"
}
$list += "<td>" + $Item.DisplayName + "</td>"
$list += "<td>" + $Item."IssueWarningQuota(MB)" + "</td>"
$list += "<td>" + $Item."TotalItemSize(MB)" + "</td>"
$list += "<td>" + $Item."ProhibitSendQuota(MB)" + "</td>"
$list += "<td>" + $Item.StorageLimitStatus + "</td>"
$list += "<td>" + $Item.ServerName + "</td>"
$list += "</tr>"
}
$list += "</table></font>"