I haven't tested this, but see if it fixes your problem:
$selection = 0
Do{
Write-Host "Select group"
Write-Host "1 = group1"
Write-Host "2 = group2"
Write-Host "3 = group3"
Write-Host "Q = Quit"
$selection = Read-Host "please select"
} While (1,2,3,"Q" -notcontains $selection)
switch ($selection) {
1 { $group = 'group1' }
2 { $group = 'group2' }
3 { $group = 'group3' }
'Q' { exit }
}
$result = Get-ADGroupMember -Identity $group |
Get-ADUser |
Select-Object givenname, surname, name
$result
Do{
$utente = Read-Host "please enter NAME to to remove user from group $group, or 'Q' to quit"
if ($utente -eq 'Q'){exit}
} while ($result.name -notcontains $utente)
Remove-ADGroupMember -identity $group -members $utente -confirm