PowerShell / PowerShell/PowerShell-RFC

Get-ChildItem IncludeRoot Parameter

Đang mở
#244 2 bình luận 3 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
PowerShell
Star
467
Fork
140
Merge trung bình
9 phút
Pull request đã merge (30 ngày)
1

Mô tả


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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với nội dung RFC và các ví dụ được liên kết để hiểu workflow Get-ChildItem được yêu cầu. Xem lại hành vi hiện tại của -Recurse, cùng với tham số IncludeRoot và đầu ra được đề xuất. Được xem là hoàn tất khi tham số, ví dụ sử dụng, đầu ra và các cân nhắc thiết kế của RFC được giải quyết đủ rõ ràng để triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
powershell
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.