# encoding: ascii
# api: powershell
# title: Test-WebDAV
# description: Quickly tests if a given web server (specified by Url parameter) is running a WebDAV service.  Should work against any server platform that supports the WebDAV RFCs.
# version: 0.1
# type: function
# author: halr9000
# license: CC0
# function: Test-WebDav
# x-poshcode-id: 3357
# x-archived: 2016-11-28T14:07:12
# x-published: 2012-04-16T02:24:00
#
#
function Test-WebDav ()
{
	param ( $Url = "$( throw 'URL parameter is required.')" )
	$xhttp = New-Object -ComObject msxml2.xmlhttp
	$xhttp.open("OPTIONS", $url, $false)
	$xhttp.send()
	if ( $xhttp.getResponseHeader("DAV") ) { $true }
	else { $false }
}
