# 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: 1120 # x-archived: 2017-05-01T04:26:09 # x-published: 2010-05-21T08:36: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 } }