Properties not appearing in the Get-Member cmdlet and registering values when put in . notation
Running
Get-ChildItem | Get-member
TypeName: System.IO.DirectoryInfo
Name MemberType Definition
---- ---------- ----------
LinkType CodeProperty System.String LinkType{get=GetLinkType;}
Mode CodeProperty System.String Mode{get=Mode;}….
There is no Count property, for the GCI cmdlet there is a count property for the Measure-object cmdlet, as seen.
PS C:\Users\NiceTry5> measure-object | get-member
TypeName: Microsoft.PowerShell.Commands.GenericMeasureInfo
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Average Property System.Nullable[double] Average {get;set;}
Count Property int Count {get;set;}
Why then does the count property of the measure-object cmdlet register a value for the GCI cmdlet?
PS C:\Users\NiceTry5> (GCI).count
32
I believe the count property must belong to some sort of superset that contains the GCI cmdlet, and is hidden when running Get-member, although I'm not sure.