I have a simple Powershell script to create a Microsoft team, channels, users, and then to associate the users with the channels. I'm currently prompting user to enter team name, and then to copy past the GroupID, as I cannot figure out how to get just the group ID. Is there any way I can just get the "GroupID" so I can assign it to a variable and not force the user to copy-paste?
Connect-MicrosoftTeams
$NewTeamName = Read-Host -Prompt 'Name of new Team'
New-Team -DisplayName $NewTeamName
Get-Team -DisplayName $NewTeamName
$GroupId = Read-Host -Prompt 'Copy and past the GroupID above'
Import-csv createTeamChannels.csv | foreach{New-TeamChannel -GroupId $GroupId -DisplayName $_.cname -MembershipType Private}
...