We have a document library which contains multiple document set we have below requirements :
- Get all document set properties like Name, Created Date, Modified date.
- Get all ItemChild (document present inside the document set) properties Name, Created Date, Modified date.
We are able to get document set properties but unable to get ItemChild properties, any lead much appreciated, Please find my below code.
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
$web = Get-SPWeb "Site URL"
$list = $web.Lists["ENERGY"]
foreach ($listItem in $list.Items)
{
$CabinetName = $listItem['Name']
$CabinetCreateDate = $listItem['Created']
$CabinetModifiedDate = $listItem['Modified']
$CabinetChildItemCount = $listItem['ItemChildCount']
Write-Host " Cabinet Name: " $listItem.Name " Modified: " $CabinetModifiedDate "Cabinet ChildItem Count" $CabinetChildItemCount "Created Date:" $CabinetCreateDate
}
$web.Dispose ()
$folders = $list.RootFolder.Subfolders foreach ($folder in $folders) { $CabinetName = $folder.Name $CabinetItemCount = $folder.ItemCount $folderItems = $folder.Item Write-Host "Cabinet Name:" $CabinetName "Cabinet Item count:" $CabinetItemCount }