0
Get-SPSite mysite | Select -ExpandProperty AllWebs | Select -ExpandProperty Lists | Select -ExpandProperty Items | Out-File outputpm.txt 

I have this code, which produces the items, one of the items is xml which can be expanded. There is a part in the xml which I want to query, so it filters down the list I already have.

5
  • I'm struggling to understand what you are trying to do, what I can decipher is that you want all lists of a SPSite which contains any item with the Title 'M' (guessing at Title)?
    – eirikb
    CommentedApr 24, 2014 at 10:22
  • no there is something in the XML item I want to query.
    – bimbob
    CommentedApr 24, 2014 at 10:25
  • the xml item is large so i'll just give one bit that it contains ows_FolderChildCount='3;#0'
    – bimbob
    CommentedApr 24, 2014 at 10:27
  • so for all items in my site I want to query the XML where ows_FolderChildCount='3;#0'
    – bimbob
    CommentedApr 24, 2014 at 10:28
  • What is '3;#0' anyway? I suspect it means $someItem["FolderChildCount"] is 0, but you need the '3', what is it?
    – eirikb
    CommentedApr 24, 2014 at 10:39

1 Answer 1

0

This is probably not the fastest solution, but it should work:

Get-SPSite mysite | select -ExpandProperty AllWebs | select -ExpandProperty Lists | select -ExpandProperty Items | ? { ([xml]$_.Xml).row.ows_FolderChildCount -eq "3;#0" } 

You could perhaps solve this with SPQuery, although I'm not sure how.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.