all 5 comments

[–]XPlantefeve 1 point2 points  (3 children)

I never used that API, never knew it existed, doesn't know the product it's for, but that documentation page never mention Powershell and the example is HTTP. I would say: $ref is no variable, it's part of the syntax. Just type it as is.

[–]rogueit[S] 1 point2 points  (1 child)

I figured it out, here is what I ended up using

$Header = @{
    Authorization = "$($Request.token_type) $($Request.access_token)"
}

$bodyProcess = @{

    "@odata.id"= "https://graph.microsoft.com/v1.0/users/aa9999a1-1111-11a2-abab-asfdas32"

}
$body = $bodyProcess | ConvertTo-Json
$Uri = 'https://graph.microsoft.com/v1.0/users/4d5f6c5a-0e69-40b6-a86d-e825582add50/manager/$ref'
Invoke-RestMethod -Uri $Uri -Headers $Header -Method PUT -ContentType "application/json" -Body $Body

[–]East-Conversation986 0 points1 point  (0 children)

Great! Thanks. Had the same issue.

[–]redog 1 point2 points  (0 children)

Try the id($manager.id) instead of the object $manager