Note, that its only the teams creation part of the script that needs to be MGGraph anything else in the script can remain using the MicrosoftTeams powershell module
$params = @{"******@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')"
displayName = "$teamname"
description = ""
firstChannelName = "General" }
$response = Invoke-MgGraphRequest -Uri "https://graph.microsoft.com/v1.0/teams" -Body $params -Method POST -OutputType HttpResponseMessage $matchSuccessful = $response.RequestMessage.RequestUri.AbsolutePath -match "\w{8}-\w{4}-\w{4}-\w{4}-\w{12}"
$groupId = $Matches.0
That script will create the team using MGGraph as a class team, so you can use notebooks, the groupid is also output to that variable for further processing in the script if you need it, you would ned to call the MGGraph at the start using
Connect-MGGraph
Import-Module Microsoft.Graph.Teams