Posts Tagged "Get"

How to read and use the contents of a website from Powershell?

Posted by on Nov 6, 2010 in Powershell | 0 comments

First we need to create a xmlhttp object, similar to what you would do in JavaScript $objXmlHttp = New-Object -ComObject MSXML2.ServerXMLHTTP Use the open method to specify the url, optional username and password. The third parameter (optional) is a boolean indicator of whether the call is asynchronous – the default is true. $objXmlHttp.Open("GET", "", $False, "username", "password") $objXmlHttp.Send() Now we can work with the results $content = $objXmlHttp.responseText $status = $objXmlHttp.status $statustext...

Read More