Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created February 27, 2014 14:00
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/9250603 to your computer and use it in GitHub Desktop.
Save martin9700/9250603 to your computer and use it in GitHub Desktop.
ForEach ($Line in $InputObject)
{ If ($Line.IndexOf("<tr><th") -ge 0)
{ $Search = $Line | Select-String -Pattern '<th ?[a-z\-:;"=]*>(.*?)<\/th>' -AllMatches
$Index = 0
ForEach ($Match in $Search.Matches)
{ If ($Match.Groups[1].Value -eq $Property)
{ Break
}
$Index ++
}
If ($Index -eq $Search.Matches.Count)
{ Write-Warning "$(Get-Date): Unable to locate property: $Property in table header"
Exit
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment