I am using this code (courtesy of Codeplex) to show all lists in a webapp.
--------------------------------------------------------------
param
(
[string] $URL,
[boolean] $WriteToFile = $true
) <o:p></o:p>
#Get
all lists in farm
Add-PSSnapin
Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue<o:p></o:p>
#Counter
variables
$webcount = 0
$listcount = 0<o:p></o:p>
if($WriteToFile
-eq $true)
{
$outputPath = Read-Host "Outputpath (e.g. C:\directory\filename.txt)"
}
if(!$URL)
{
#Grab all webs
$webs = (Get-SPSite -limit all | Get-SPWeb -Limit all -ErrorAction
SilentlyContinue)
}
else
{
$webs = Get-SPWeb $URL
}
if($webs.count -ge 1 -OR $webs.count -eq $null)
{
foreach($web in $webs)
{
#Grab all lists in the current web
$lists = $web.Lists
Write-Host "Website"$web.url -ForegroundColor Green
if($WriteToFile -eq $true){Add-Content -Path $outputPath -Value "Website
$($web.url)"}
foreach($list in $lists)
{
$listcount +=1
Write-Host " – "$list.Title
if($WriteToFile -eq $true){Add-Content -Path $outputPath -Value " –
$($list.Title)"}
}
$webcount +=1
$web.Dispose()
}
#Show total counter for checked webs & lists
Write-Host "Amount of webs checked:"$webcount
Write-Host "Amount of lists:"$listcount
}
else
{
Write-Host "No webs retrieved, please check your permissions"
-ForegroundColor Red -BackgroundColor Black
}<o:p></o:p>
------------------------------------------------------
I need to set a filter to show me only lists that
- have the word "workflowhistory"
- have over 7000 items
I tried using the qualifier
| Where { ($_.item -like '*workflowhistory*')} but no luck!
Thanks again for help!
----------------------------