Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created February 27, 2014 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martin9700/9251019 to your computer and use it in GitHub Desktop.
Save martin9700/9251019 to your computer and use it in GitHub Desktop.
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