PowerShell / PowerShell/PowerShellEditorServices
Clear secondary streams on primary PowerShell object
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 767
- Fork
- 266
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
Currently we reuse the same PowerShell object for every script invocation/prompt evaluation, but we aren't clearing the streams afterward. Example:
PS> $context = $psEditor.Components.Get([Microsoft.PowerShell.EditorServices.PowerShellContext])
PS> $ps = $context.GetType().GetField('powerShell', 60).GetValue($context)
PS> $ps.Streams.Information
# <Empty>
PS> Write-Host 'first message'
PS> $ps.Streams.Information
# first message
PS> Write-Host 'second message'
PS> $ps.Streams.Information
# first message
# second message
Same for the other streams e.g. warning, verbose, debug, and progress (even though progress is not shown, the record is still stored until the end of the session)
Depending on how long the PSIC is left open and how much these streams are being written to, this could be the cause of some reported memory usage issues.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ phần mã tái sử dụng đối tượng PowerShell chính cho các lần gọi script và đánh giá prompt, sau đó kiểm tra các collection Streams.Information, warning, verbose, debug và progress của đối tượng này. Tái hiện việc tích lũy được nêu trong issue và theo dõi thời điểm mỗi lần gọi hoàn tất. Được xem là hoàn thành khi các bản ghi stream phụ không tồn tại qua các lần gọi, bao gồm cả các bản ghi progress, và hành vi này được bao phủ bởi các test liên quan nếu có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, powershell
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- 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
- 45/100