FunctionsPublic/Get-GraphSharepointSiteOfGroup.ps1
function Get-GraphSharepointSiteOfGroup { param([psobject]$accessToken, [string]$groupID) # # Get Sharepoint site corresponding to group # $responseBody = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/groups/$($groupID)/sites/root" -Headers @{"Authorization" = "Bearer $($accessToken.AccessTokenCredential.GetNetworkCredential().password)"} $jsonResponse = $responseBody | ConvertTo-JSON $sharepointSite = ConvertFrom-Json -InputObject $jsonResponse return $sharepointSite } |