FunctionsPublic/Set-GraphGroupDisplayName.ps1
function Set-GraphGroupDisplayName { param([psobject]$accessToken, [string]$groupID, [string]$newDisplayName) # # Create new unified group # $sendBody = @{ "displayName"= "$($newDisplayName)" } | ConvertTo-Json $responseBody = Invoke-RestMethod ` -Uri "https://graph.microsoft.com/v1.0/groups/$($groupID)" ` -Headers @{"Authorization" = "Bearer $($accessToken.AccessTokenCredential.GetNetworkCredential().password)"} ` -Body $sendBody ` -ContentType "application/json" ` -Method PATCH $jsonResponse = $responseBody | ConvertTo-JSON $createdTeam = ConvertFrom-Json -InputObject $jsonResponse return $createdTeam } |