Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- $response = Invoke-WebRequest @myparams -EA Stop
- # do more stuff with the response
- } catch [System.Net.WebException] {
- # parse the JSON response body for error details
- }
- try {
- $response = Invoke-WebRequest @myparams -EA Stop
- # do more stuff with the response
- } catch [System.Net.WebException] {
- # Desktop: parse the JSON response body for error details
- } catch [Microsoft.PowerShell.Commands.HttpResponseException] {
- # Core: parse the JSON response body for error details
- }
Add Comment
Please, Sign In to add comment