Check HTTP Status with Powershell
Code
XML File
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<webservices>
<webservice process="Yahoo" subprocess="Yahoo Root" link="http://www.yahoo.de prio="high" />
<webservice process="Google" subprocess="Google Root" link="http://www.google.de" prio="high" />
<webservice process="Heise" subprocess="Heise Root" link="http://www.heise.de" prio="high" />
<webservice process="Slash4" subprocess="Slash4 Root" link="http://www.slash4.de" prio="high" />
</webservices>
Powershell Script
$url = "http://www.slash4.de/wwwtest/webservice.xml"
$WebClient = New-Object System.Net.WebClient
$GUID = [guid]::NewGuid()
$file = (gc Env:\TEMP) + "\$GUID.xml"
$WebClient.DownloadFile($url,$file)
[XML]$WWWTest = Get-Content $file
$starttime = get-date -format yyyy-MM-dd_hh-mm-ss
$i = 1
foreach ($link in ($WWWTest.webservices.webservice | %{$_|>.link}))
{
$xHTTP = new-object -com msxml2.xmlhttp
$xHTTP.open("GET",$link,$false)
$xHTTP.send()
$bv = $xHTTP.status
if ($bv -eq 200)
{ write-host "$i `t $link $bv" -ForegroundColor Green }
else
{ write-host "$i `t $link $bv" -ForegroundColor Red }
$i++
}
$endtime = get-date -format yyyy-MM-dd_hh-mm-ss
$starttime
$endtime
rm $file