Is there a way to get the items that are present in a particular view of a sharepoint library? Actually my library has multiple levels of folders like this:
Level1 Document set
Level2 Folders and some Items
Level3 Folders and some items ...so on
what I am trying to do is I will select the "Show all Items without folders" option in view and try to access all the items using powershell, since that will be easier. How can I do it? Here is my script as requested:
Add-PSSnapin Microsoft.SharePoint.PowerShell
$web = Get-SPWeb "http://MySite"
$library = $web.Lists["Test"]
$view = $library.Views["All Documents"]
foreach($item in $list.GetItems($view))
{
write-host $item["Name"]
}
Actual content of All documents view
Content After Filter:
The ouput is : A B C while it should be only A right?