How to use PnP PowerShell to get a list of classic lists on a SharePoint Online site

We have a SharePoint modernization project happening at work. As part of our analysis, we need to identify lists and libraries using the classic experience. I recently wrote about how I'm using ChatGPT to figure this out, but today it was hallucinating and giving me the wrong answers. After a few minutes of searching, I finally found the right solution, and I'm creating this note for myself.

Connect-PnPOnline $SiteUrl -Interactive
$Lists = Get-PnPList -Includes ListExperienceOptions
foreach ($List in $Lists) {
	$Experience = $List.ListExperienceOptions
	$ListTitle = $List.Title
	if ($Experience -eq 'ClassicExperience') {
		Write-Host "$ListTitle is using Classic Experience"
	}
}

That's all for now.

Reply by email