I have a simple Powershell function to call a web api and get a response. How to find out if the web api call succeeded or failed. If failed how can i log only the failed except