

$count = $stream.Read($receiveMessageBytes, 0, $tcpclnt.ReceiveBufferSize) $receiveMessageBytes = New-Object byte $tcpclnt.ReceiveBufferSize $clientLength = $tcpclnt.ReceiveBufferSize $stream.Write($binaryMessage, 0, $binaryMessage.Length) $binaryMessage = ::ASCII.GetBytes($request) $request += “Host: $($Uri.host)” + ::NewLine + ::NewLine $request = “GET $($Uri.AbsolutePath)” + ” HTTP/1.1″ + ::NewLine

#-i am only posting required parts of my script to make it easier to post, no guarantee that it won’t need some minor bug fixes. If anyone can help me with authenticating the connection (similar to -usedefaultcredentials in the invoke-webrequest commandlet), or just a better solution in general i would greatly appreciate it. I haven’t been able to figure out how to authenticate the request, but it works for anonymous websites. This is what i’ve been doing to test separate nodes of a load balanced website. ResponseTime = "$(($now - $then).totalseconds)" Calling the GetResponse() method shows you the following:
