title: How to obtain numeric HTTP status codes in PowerShell
body: <p>I know of a <a href="http://scriptolog.blogspot.com/2007/08/query-http-status-codes-and-headers.html" rel="noreferrer">few good ways</a> to build web clients in PowerShell: the .NET classes System.Net.WebClient and System.Net.HttpWebRequest, or the COM object Msxml2.XMLHTTP.  From what I can tell, the only one which gives you access to the numeric status code (e.g. 200, 404), is the last, the COM object.  The problem I have is that I don't like the way it works and I don't like relying on the COM object being there.  I also know that from time to time Microsoft will decide to kill COM objects (ActiveX kill bits) due to security vulnerabilities and so on.</p>
  
  <p>Is there another .NET method I'm missing?  Is the status code in one of these other two objects and I just don't know how to get at it?</p>