PowerShell / PowerShell/PowerShell-RFC

ConvertFrom/To-Hashtable and/or ConvertTo-PSCustomObject cmdlets

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

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

Up-for-Grabs
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ả

Related discussion in #109, specifically this comment:

Finally got around to reviewing this with @PowerShell/powershell-committee.

It sounds like the problem that's being solved here is to convert nested hashtables to PSCustomObjects when the keys are all strings (when they're not strings, conversion will likely result in key collision due to ToString() returning type names).

To that end, we think it's more generically useful to build a ConvertFrom-Hashtable cmdlet that would allow more generic and custom conversion of hashtables to PSCustomObjects and potentially other types using constructors that expect specific hashtable "schemas". Another possible implementation is to do a ConvertTo-PSCustomObject that does more custom handling (and these aren't mutually exclusive). Additionally, a ConvertTo-Hashtable is probably useful.

We don't have this on our radar right now, but if someone wants to give a go at a ConvertFrom-Hashtable RFC and implementation, go for it.

We think the scenario we're trying to address is primarily casting nested hashtables of hashtables into PSCustomObjects (or possibly even other types).

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 cuộc thảo luận liên quan trong issue #109, đặc biệt là bình luận được liên kết, để hiểu các kịch bản chuyển đổi được đề xuất và phạm vi chưa được giải quyết. Xác định xem công việc nên bao gồm ConvertFrom-Hashtable, ConvertTo-PSCustomObject, ConvertTo-Hashtable hay nhiều cmdlet; để được coi là hoàn thành, cần có một RFC tập trung, sẵn sàng nhận phản hồi từ PowerShell Committee và tiến hành bỏ phiếu.

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
Cần làm rõ
Mức phù hợp với người mới
25/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.