Get-ChildItem IncludeRoot Parameter
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- powershell
- Domain
- cli
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.
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.
- Dominant language
- PowerShell
- Stars
- 468
- Forks
- 143
- Avg merge
- 9m
- Merged PRs (30d)
- 1
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.
More from PowerShell/PowerShell-RFC
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PowerShell/PowerShell-RFC#404 · 1 comment ·
-
PowerShell/PowerShell-RFC#407 · 1 comment · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
PowerShell/PowerShell-RFC#396 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
PowerShell/PowerShell-RFC#334 · 2 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
PowerShell/PowerShell-RFC#327 · 28 comments · 31 reactions ·
All issues in PowerShell/PowerShell-RFC
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1424 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
paritytech/zombienet-sdk#591 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mruangutai/harness#1897 ·
-
os:linux
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
mpv-player/mpv#18510 · 2 comments ·