Created
March 23, 2015 13:32
-
-
Save martin9700/d7cd8d8fa2d8929e51ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If ($Line -like "*<td>*") | |
{ | |
#Check the column for a value change, and if so swap the designated class | |
$Search = $Line | Select-String -Pattern "<td>.*?</td>" -AllMatches | |
If ($LastColumn -ne $Search.Matches[$Index].Value) | |
{ | |
If ($Class -eq $CSSEvenClass) | |
{ | |
$Class = $CSSOddClass | |
} | |
Else | |
{ | |
$Class = $CSSEvenClass | |
} | |
} | |
$LastColumn = $Search.Matches[$Index].Value | |
$Line = $Line.Replace("<tr>","<tr class=""$Class"">") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment