#powershell vs. unix scripting: calling a REST API endpoint and wanting to see full response even in case of 400-500 response type.
linux: curl -i http://localhost/api/foo
powershell: try { Invoke-WebRequest -UseBasicParsing “http://localhost/api/foo” } catch [System.Net.WebException] {$webExObj = $_.Exception; $webExObj.Response; [System.IO.StreamReader]::new($webExObj.Response.GetResponseStream()).ReadToEnd()}
would love to use some better approach for PS but that is all I got currently