PowerShell / PowerShell/PowerShell-RFC

Get-ChildItem IncludeRoot Parameter

未关闭
#244 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
PowerShell
星标
467
派生
140
平均合并
9 分钟
30 天内合并 PR
1

描述


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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 RFC 文本和链接的示例开始,以了解所请求的 Get-ChildItem 工作流。检查当前的 -Recurse 行为,以及提议的 IncludeRoot 参数和输出。当 RFC 的参数、使用示例、输出和设计考量都得到足够妥善的解决,可以进行实现时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
powershell
领域
cli
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。