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