#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#CAML Query to Filter List Items
$Query = “Completed”

#Get All List Items matching given query
$ListItems = Get-PnPListItem -List $ListName -Query $Query

#Loop through each Item
Write-host -f Green “Number of List Items Found:”$ListItems.Count
ForEach($ListItem in $ListItems)
{
Write-Host “Id :” $ListItem[“ID”]
Write-Host “Title :” $ListItem[“Title”]
}