I have this powershell script to delete all items from a list:
$siteURL = "URL"
$site = new-object Microsoft.SharePoint.SPSite ( $siteURL )
$web = $site.OpenWeb()
$oList = $web.Lists["ListName"];
$collListItems = $oList.Items;
$count = $collListItems.Count -1;
for($intIndex = $count; $intIndex -ge 0; $intIndex--)
{
$collListItems[$intIndex].Delete();
}
I was wondering if it is possible to edit this script to only delete items that were created over 90 days ago (or delete items that were created before a certain date)?