My eventual goal is to be able to check on new items added to a Content List but I was trying to figure out if there was a CmdLet that could let me access the Content List in a SharePoint Site. I have a PowerShell script that allows me to get a view into the Content in the site but this is more high level, ideally I would like to be able to get into the sub-sites to look into the content there as well.
Is there something that is already avaiable that might give me access from outside the site, using PowerShell ideally, to be able to get the list of content. This would only need to come out with a list, like a report, so I can get an idea of content in a list or even separate it out according to date.
This is an example of the code I am already using to get an idea of the Content in a Site.
# This uses SPWeb, Lists properties
$folderList = $siteWeb.Lists[$libraryName]
$global:totalFolders += $folderList.Folders.Count
# Review all items within the List that are folders, and get their counts
# This is using SPWeb, Folders properties, which gets all items as first-level folders
# This makes $folderItem an SPList object
# More on Folders: http://msdn.microsoft.com/en-us/library/ms437326.aspx
foreach ($folderItem in $folderList.Folders)
{
if ( ($folderItem.Folder.ItemCount -gt 0) -and ($folderItem.Name -cnotmatch "False") )
{
Write-Host "Folder: " $folderItem.Name "Count: " $folderItem.Folder.ItemCount
$global:totalCount += $folderItem.Folder.ItemCount
$gc = Start-SPAssignment
$site = $gc | Get-SPWeb $url
$items = Get-SPFilesInFolder $site "Pages" $folderItem.Name
# $items | fl -Expand Both
$newItems = $items | where{$_.HasPublishedVersion -eq "True"}
$global:totalPublished += $newItems.Count
$invisItems = $items | where{$_.HasPublishedVersion -ne "True"}
$global:totalUnPublished += $invisItems.Count
$gc | Stop-SPAssignment
}
My focus on PowerShell is we do a lot of administration through that now and I would just like to add this as a new part of our PowerShell work that I am more comfortable with rather than a web part - which I am not comfortable with.