PowerShell / PowerShell/PowerShell-RFC
Get-ChildItem IncludeRoot Parameter
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 467
- Forks
- 140
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
RFC:
Author: John Bevan
Status: Draft
SupercededBy:
Version:
Area: Standard Functions
Comments Due:
Plan to implement:
Get-ChildItem; Add IncludeRoot Switch
Suggestion: Currently if you wish to fetch an item and its children you have to make a call to Get-Item and Get-ChildItem. Since this is a common use case, it would be good to reduce this to a single call. By adding an IncludeRoot switch to Get-ChildItem we could easily have it fulfill this requirement.
Here are some examples of people who've hit this scenario & tried to get creative in resolving it.
Motivation
As a PowerShell user,
I can retrieve an item and its children,
so that I have the full tree returned in a single result set.
User Experience
Example of user experience with example code/script.
Include example of input and output.
Get-ChildItem -Path 'c:\demo' -IncludeRoot -Recurse | Select-Object -ExpandProperty FullName
c:\demo
c:\demo\subfolder
c:\demo\subfolder\one.txt
c:\demo\subfolder\two.txt
Specification
Include [Parameter()][Switch]$IncludeRoot in the list of available parameters.
Alternate Proposals and Considerations
The current workaround is to make separate calls to Get-Item and Get-ChildItem.
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
Start with the RFC text and the linked examples to understand the requested Get-ChildItem workflow. Review the current -Recurse behavior and the proposed IncludeRoot parameter and output. Done means the RFC's parameter, usage example, output, and design considerations are resolved well enough for implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100