Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Clear secondary streams on primary PowerShell object

未關閉
#791 2 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
csharp, powershell
領域
tooling

研究方向

從重複使用主要 PowerShell 物件來進行指令碼呼叫和提示評估的程式碼開始,然後檢查其 Streams.Information、warning、verbose、debug 和 progress 集合。重現 issue 中顯示的累積情況,並追蹤每次呼叫何時完成。完成的標準是,次要串流記錄不會在呼叫之間持續存在,包括 progress 記錄;如果有相關測試,則該行為也應由這些測試涵蓋。

由索引模型根據 Issue 內容生成。

描述

Area-Extension Terminal Issue-Enhancement

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.

主要語言
C#
星號
767
分支
266
平均合併
3 天 16 小時
30 天內合併 PR
1

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

PowerShell/PowerShellEditorServices 的其他 Issue

查看 PowerShell/PowerShellEditorServices 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。