where does .count come from?

Welcome Forums General PowerShell Q&A where does .count come from?

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
1 year, 7 months ago.

  • Author
    Posts
  • #69097

    Participant
    Points: 0
    Rank: Member

    Okay, if I do a (dir *.dll).count in a folder (say system32). I get the number of dll files in that folder. But if I do a (dir *.dll) | gm
    Well, I don't see count listed in the output. So where does it come from, and what other ones are there?

    (add: Never mind, I found it in the about_properties file, under PROPERTIES OF SCALAR OBJECTS AND COLLECTIONS.)

  • #69373

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    The commands produce a collection of objects. Get-Member normally shows you the members of what's _inside_ the collection, rather than the collection itself, which is where the Count property comes from.

The topic ‘where does .count come from?’ is closed to new replies.