Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
If ($Line.IndexOf("<tr><td") -ge 0)
{ $Search = $Line | Select-String -Pattern '<td ?[a-z\-:;"=]*>(.*?)<\/td>' -AllMatches
$Value = $Search.Matches[$Index].Groups[1].Value -as [double]
If (-not $Value)
{ $Value = $Search.Matches[$Index].Groups[1].Value
}
If (Invoke-Command $Filter)
{ Write-Verbose "$(Get-Date): Criteria met! Changing cell to $Color..."
$Line = $Line.Replace($Search.Matches[$Index].Value,"<td style=""background-color:$Color"">$Value</td>")
}
}
Write-Output $Line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment