Get List Item count from specific site with the metadata.
$cred = Get-Credential
Connect-PnPOnline -Url https://<TenentName>.sharepoint.com/sites/developer/ -Credentials $cred
$ListItemCollection = @();
$Lists = Get-PnPList
foreach($list in $Lists){
$row = New-Object psobject
Add-Member -InputObject $row -MemberType NoteProperty -Name "ListName" -Value $list.Title
Add-Member -InputObject $row -MemberType NoteProperty -Name "ListURL" -Value $list.RootFolder.ServerRelativeUrl
Add-Member -InputObject $row -MemberType NoteProperty -Name "ItemCount" -Value $list.ItemCount
Add-Member -InputObject $row -MemberType NoteProperty -Name "LastModifyOn" -Value $list.LastItemModifiedDate
$ListItemCollection += $row;
}
$ListItemCollection | Export-CSV "D:\ListData.csv" -NoTypeInformation
Sharing is Caring 🙂