creating groups and assigning rights at list level

Hi so I am trying to string together a script that does the following:

1. creates a list within a site collection

2. Removes all inherited permissions

3. Creates 3 groups at the list level (group name: listname_read, listname_edit, listname_owner) and assigns them rights (read, edit, owner)

I have been able to accomplish 1 & 2 but not 3. 

I am by no means any kind of PS expert, what I have atm is from stringing together scripts off the net.

Can you please help me complete my script and acheive part 3 above? here is what I have so far:

function new-SPOnlineList {
#variables that needs to be set before starting the script
$siteURL = "https://***.sharepoint.com/sites/bsr"
$adminUrl = "https://***-admin.sharepoint.com"
$userName = "spoadmin@***.onmicrosoft.com"
$listTitle = Read-Host "Please enter the name for the doc library"
$listDescription = $listTitle
$listTemplate = 101

# Let the user fill in their password in the PowerShell window
$password = Read-Host "Please enter the password for $($userName)" -AsSecureString

# set SharePoint Online credentials
$SPOCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $password)

# Creating client context object
$context = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL)
$context.credentials = $SPOCredentials

#create list using ListCreationInformation object (lci)
$lci = New-Object Microsoft.SharePoint.Client.ListCreationInformation
$lci.title = $listTitle
$lci.description = $listDescription
#$lci.
$lci.TemplateType = $listTemplate
$list = $context.web.lists.add($lci)
$context.load($list)
#send the request containing all operations to the server
try{
$context.executeQuery()
write-host "info: Created $($listTitle)" -foregroundcolor green
}
catch{
write-host "info: $($_.Exception.Message)" -foregroundcolor red
}

#Load list and break inheritance
$web = $context.web.Lists.GetByTitle($ListTitle)
$context.load($web)
$web.breakroleinheritance($false, $false)
$web.update()
#send the request containing all operations to the server
try{
$context.executeQuery()
write-host "info: Broken inheritance for $($web.title)" -foregroundcolor green
}
catch{
write-host "info: $($_.Exception.Message)" -foregroundcolor red
}
}

new-SPOnlineList

 

Thanks alot!!