I am trying to grab a specific list, and then read through the items in the list one by one, I tried a count but this does not work as a count is just a number of found entries where the ID may not be the same.
$web = get-spweb https://sp.test.com/site1/
foreach($site in $web.Site.Allwebs)
{
if($site.Url -like '*sites1/SecureSp/*') {
$lists = $site.Lists
foreach($list in $lists)
{
if($list.Title -like 'Info')
{
$siteForList = get-spweb $site.Url
# Get Iternal Field Names For List Start
$StatusItems = $siteForList.Lists['info']
# Get Iternal Field Names For List End
$listItemsCount = $caseStatusItems.ItemCount
#$caseStatusItems
for($i = 1; $i -le $listItemsCount; $i++)
{
$listItem = $item.GetItemByID($i)
$listItemsCount
<#
if($listItem["Created"] -like '*5/18/2017*' -OR $listItem["Created"] -like '*5/17/2017*')
{
write-host "----------------------------------------------------------------------------------------------------" -foregroundcolor red
write-host "URL: " -foregroundcolor green
$siteForList.Url
write-host "Subject: " -foregroundcolor green
$listItem["Subject"]
write-host "Created By: " -foregroundcolor green
$listItem["Created By"]
write-host "Created: " -foregroundcolor green
$listItem["Created"]
write-host "Last Updated: " -foregroundcolor green
$listItem["Last Updated"]
write-host "ID: " -foregroundcolor green
$listItem["ID"]
write-host "----------------------------------------------------------------------------------------------------" -foregroundcolor red
}
#>
}
$siteForList.Dispose()
}
}
}
}