Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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