Test-WebDAV (modification of post by view diff)
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1120"></script>download | new post
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.
- 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 }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository