-ErrorAction
parameter of New-PSUEndpoint
to Stop
. Any errors will cause an 500 Internal Server Error to be returned with a list of the errors and stack trace.New-PSUApiResponse
cmdlet. This cmdlet allows you to define the status code and body for the response.