I am currently doing some basic API REST test with powershell.
However, I am having an issue with capturing a specific output data
For example:
$bearer = Invoke-RestMethod -Method POST -Body $body -uri "https://api.yourwebsite.com/oauth/token"
Output:
access_token
------------
{longtokenhere}
But when using it with the header:
$header = @{Authorization = "Bearer "+$bearer}
Output is:
Name Value
---- -----
Authorization Bearer @{access_token={longtokenhere}}
I would like to know how will I be able to remove the " @{access_token=}" part so I can just use the {longtokehere} only?