function Get-WebServer {
param ($target)
if (-not ($target -like "http://*")) {
$target = "http://" + $target
}
$wr = [System.Net.WebRequest]::
$wr.UserAgent = "InterwebExploder 10.0 RC1 - 'Titanic'"
$header = $wr.GetResponse()
Write-host "$target"
$header | select Server, LastModified, ProtocolVersion, ResponseUri | Format-List
}
Please note that proxies and various other issues can ruin the function.
To use the function, simply call it with the name of the target url:
Get-WebServer "www.blogspot.com"
No comments:
Post a Comment