Get-ChildItem IncludeRoot Parameter
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- powershell
- 领域
- cli
调研方向
从 RFC 文本和链接的示例开始,以了解所请求的 Get-ChildItem 工作流。检查当前的 -Recurse 行为,以及提议的 IncludeRoot 参数和输出。当 RFC 的参数、使用示例、输出和设计考量都得到足够妥善的解决,可以进行实现时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- PowerShell
- 星标
- 468
- 派生
- 143
- 平均合并
- 9 分钟
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PowerShell-RFC 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
PowerShell/PowerShell-RFC#404 · 1 条评论 ·
-
PowerShell/PowerShell-RFC#407 · 1 条评论 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 35/100
PowerShell/PowerShell-RFC#396 ·
-
难度 5/5 一周以上 新手友好度 20/100
PowerShell/PowerShell-RFC#334 · 2 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
PowerShell/PowerShell-RFC#327 · 28 条评论 · 31 个 reaction ·
查看 PowerShell/PowerShell-RFC 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
nightscout/nocturne#1424 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
paritytech/zombienet-sdk#591 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
mruangutai/harness#1897 ·
-
os:linux
难度 2/5 1-3 小时 新手友好度 70/100
mpv-player/mpv#18510 · 2 条评论 ·