I know of a few good ways 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
Use the [system.net.httpstatuscode]
enumerated type.
ps> [enum]::getnames([system.net.httpstatuscode])
Continue
SwitchingProtocols
OK
Created
Accepted
NonAuthoritativeInformation
NoContent
ResetContent
...
To get the numeric code, cast to [int]:
ps> [int][system.net.httpstatuscode]::ok
200
Hope this helps,
-Oisin