UPDATE: I got one step further. Succeeded with get-command, too. But only header (like requested).
Hi @Carsten ,
thanks a lot for Your answer.
Succeeded with requesting the access Token.
Requesting data I try with
$response = Invoke-RestMethod -Uri $odataUrl -Method Get -Headers @{
"Authorization" = "Bearer $accessToken"
}
results in
Invoke-RestMethod : ErrorFailed while retrieving oauth token: Unauthorized
In Zeile:1 Zeichen:13
+ $response = Invoke-RestMethod -Uri $odataUrl -Method Get -Headers @{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-R
estMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRest
MethodCommand
No matter if keep “Bearer” or opening and closing “.
Is the command itself a correct one?