Get Page TitleThis powershell function will retrieve the title text of a specified HTML page.
Added 277 days ago by Emnico
| Download | |
| Review | ||
| Back | ||
| 68 | Views |
Source code
# Returns the value of the title tag from an html page
# Example usage: Get-Title http://emnico.com
Function Get-Title {
param([string] $url)
$wc = New-Object System.Net.WebClient
$data = $wc.downloadstring($url)
$title = [regex] '(?<=<title>)([\S\s]*?)(?=</title>)'
write-output $title.Match($data).value.trim()
}
Get-Title http://emnico.com

