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