I am sending a query with Invoke-WebRequest
and want to output a value from the response header. For this I wrote a function that contains the following query:
Invoke-RestMethod @Params -ResponseHeadersVariable ResponseHeader
The Result as expected:
$ResponseHeader.'OData-EntityId'
xxxx-xxxx-xxxx-xxxxxxx
However, if I put this logic into a function, I get an additional blank line that interferes with further processing of the value. How do I get rid of it?