PowerShell / PowerShell/PowerShell
Get-Member doesn't consistently show members that are explicit interface implementations as such
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 55.5k
- Forks
- 8.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 88
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Get-Member -InputObject (1, 2) Add, Count
-
The
.Add()method is properly reported as a member of the explicit implementation of theIListinterface - see https://docs.microsoft.com/en-us/dotnet/api/system.array.system-collections-ilist-add -
By contrast, the
.Countproperty is not reported as a member of the explicit implementation of theICollectioninterface - see https://docs.microsoft.com/en-US/dotnet/api/system.array.system-collections-icollection-count#system-array-system-collections-icollection-count
Expected behavior
TypeName: System.Object[]
Name MemberType Definition
---- ---------- ----------
Add Method int IList.Add(System.Object value)
Count Property int ICollection.Count {get;}
Actual behavior
TypeName: System.Object[]
Name MemberType Definition
---- ---------- ----------
Add Method int IList.Add(System.Object value)
Count Property int Count {get;}
Error details
No response
Environment data
PowerShell Core 7.3.0-preview.5
Visuals
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the provided Get-Member reproduction on PowerShell 7.3.0-preview.5 or a current build, then trace the Get-Member implementation and its member-reflection handling. Done means explicit interface members such as ICollection.Count are displayed consistently with IList.Add, matching the expected output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100