Я хотел бы удалить все документы в корневых папках списка SP с именем RecordsDocument
.
Ниже приведен мой текущий скрипт (в настоящее время удаляются папки):
$web = Get-SPWeb "http://url.com"
$Libraries = $web.Lists | where {$_.BaseType -eq "DocumentLibrary"}
$RecordDocumentTotalCount = 0
foreach ($library in $Libraries) {
if ($($library.Title) -eq "RecordsDocument")
{
Write-Output "Getting folders from $($library.Title)"
$Folders = $library.Items | where {$_.FileSystemObjectType -eq "Folder"}
foreach ($folder in $Folders)
{
Write-Output "Deleting folder $($folder.Name)..."
#$file.Delete()
}
}
}
Однако в каждой папке есть Document Set
, а в каждой Document Set
есть документы.
Как удалить документы в корневой папке вместо очистки всей папки?
Спасибо.