try { $status = wget $url | % {$_.StatusCode.ToString()} } catch [exception] { $status = $_.Exception.Message.ToString() }