I have a powershell sharepoint script that give me all items in a document library of a site. Problem is, I get Documents I don't want. Like home.aspx and some other regular documents from sharepont itself My first idea was to exclude this document librarys which have this files inside. But I hobe there is a better solution to do this job. I use the sharepoint client component sdk. Maybe you can help me here.
Small Code Snippet:
ForEach($List in $Lists)
{
if(($List.BaseType -eq "DocumentLibrary") -and ($List.Hidden -eq $false) -and ($list.EnableVersioning) -and ($list.Name -ne "Forms") -and ( $List.Name -ne "Site Assets") ){
$Query = New-Object Microsoft.SharePoint.Client.CamlQuery
$Query.ViewXml="@<View Scope='RecursiveAll'>
<Query>
<Where>
<Eq>
<FieldRef Name='FSObjType'/><Value Type='Integer'>0</Value>
</Eq>
</Where>
</Query>
</View>"
$ListItems = $List.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery())
$Ctx.Load($ListItems)
$Ctx.ExecuteQuery()