0

In my powershell script, I get all lists, then loop through and filter based on if its a document library and if its a certain content type, but I want to do this through CAML.

This is the loop logic

# get all the lists from the source location
$sourceLists = $sourceWebObj.Lists;

# loop through all lists
foreach ($sourceList in $sourceLists) {

    # check if it's a valid document library and it's content type is what we want
    if($sourceList.BaseType -eq "DocumentLibrary" -and $sourceList.ContentTypes[$DocLibContentType] -ne $null) {

    }
}

How can I do the same thing with CAML?

Thanks

1 Answer 1

1

CAML query is used to get information from List.

You requirement is to filter Lists which belongs to object Web. We can't use CAML for that.

I would suggest you use PowerShell piping etc.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.