claude-code - 💡(How to fix) Fix PowerShell tool drops pipeline output when result uses default formatter (no Format-Table/Format-List)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The PowerShell tool returns (PowerShell completed with no output) for commands whose output relies on PowerShell's implicit/default formatter, even when the command genuinely produces objects. Appending | Format-Table (or | Format-List / | Out-String) to the exact same command makes the output appear correctly.

Root Cause

The PowerShell tool returns (PowerShell completed with no output) for commands whose output relies on PowerShell's implicit/default formatter, even when the command genuinely produces objects. Appending | Format-Table (or | Format-List / | Out-String) to the exact same command makes the output appear correctly.

Code Example

Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime

---

Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime | Format-Table

---

Id ProcessName StartTime
      -- ----------- ---------
   10592 explorer    5/14/2026 2:06:24 PM
RAW_BUFFERClick to expand / collapse

Summary

The PowerShell tool returns (PowerShell completed with no output) for commands whose output relies on PowerShell's implicit/default formatter, even when the command genuinely produces objects. Appending | Format-Table (or | Format-List / | Out-String) to the exact same command makes the output appear correctly.

Reproduction

On Windows 11, PowerShell 7+ (pwsh), via Claude Code's PowerShell tool:

  1. Run:

    Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime

    → Tool reports: (PowerShell completed with no output)

  2. Run the identical command with | Format-Table appended:

    Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime | Format-Table

    → Tool returns the expected row, e.g.:

       Id ProcessName StartTime
       -- ----------- ---------
    10592 explorer    5/14/2026 2:06:24 PM

The underlying process exists in both cases; only the rendering differs.

Expected behavior

The tool should capture and return whatever PowerShell's default host would render — i.e. objects emitted to the success stream should be formatted to text (equivalent to | Out-String -Stream) before being returned, just as an interactive pwsh session does.

Actual behavior

Without an explicit Format-* cmdlet, the output stream appears empty to the tool, leading to misleading "no output" results and forcing users (and the model) to add formatter cmdlets defensively.

Impact

  • Misleading diagnostics — "no output" looks like "no matching process" or "command failed silently."
  • Wastes turns — the model often re-runs the command or invents explanations for the empty result.
  • Breaks parity with interactive pwsh, where the same one-liner works as written.

Related /feedback submission

This bug was also submitted via Claude Code's /feedback command.

  • Feedback ID: 84e84c3c-a605-4069-b029-0af8c88ae656
  • Submitted: 2026-05-16T02:58:01.524Z
  • Session ID: b69dfbc4-f591-4cb1-8807-cd5d226bfe1a
  • Claude Code version: 2.1.143

Minor sub-issue noticed while preparing this report: the Feedback ID that /feedback prints to the terminal UI is not written into the session JSONL log — only the Feedback / bug report submitted line is persisted. The ID is therefore lost if the user closes the terminal or scrolls past it. Worth either logging it alongside the existing local-command-stdout event, or echoing it back when the user later runs /feedback (or a hypothetical /feedback list).

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Shell: PowerShell 7+ (pwsh), invoked via Claude Code PowerShell tool
  • Claude Code model: Opus 4.7 (1M context)
  • Claude Code version: 2.1.143
  • Date observed: 2026-05-15

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The tool should capture and return whatever PowerShell's default host would render — i.e. objects emitted to the success stream should be formatted to text (equivalent to | Out-String -Stream) before being returned, just as an interactive pwsh session does.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING