How to check list views that has more than 12 lookup columns in SharePoint

So I was on a customer who asked me which lists, actually views, has more than 12 lookup fields, that we all know impacts directly in our SharePoint performance. Here is it, enjoy! param( [Parameter(Mandatory = $false)] $fooparameter = “foovalue” ) $spsnapin = Get-PSSnapin | ? {$_.Name -eq “Microsoft.SharePoint.PowerShell”} if (!$spsnapin) {Add-PSSnapin “Microsoft.SharePoint.PowerShell”} $badviews =…