-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-ChildItem IncludeRoot Parameter #244
Comments
Doesn't this defeat the point of the command? In what use cases would you use this added parameter? |
I understand your point; that the name of the command uses the world "Child". However I wouldn't use the phrase "defeats the point" as this doesn't impact the current functionality; and there's not an existing way (with a single command) to get a folder and its decedents. Rather I'd say it adds flexibility. Perhaps adding a
In most cases where I'd call A couple of examples I can think of when this would be useful are:
.. but really most cases where you'd be interested in the folders of Get-ChildItem there's likely a case where the parent may be of equal interest to its content. |
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
andGet-ChildItem
. Since this is a common use case, it would be good to reduce this to a single call. By adding anIncludeRoot
switch toGet-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
User Experience
Example of user experience with example code/script.
Include example of input and output.
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
andGet-ChildItem
.The text was updated successfully, but these errors were encountered: