PowerShell Inline Eval runs PowerShell code in a persistent session and shows the result directly in your editor. It is built for quick feedback while scripting, without switching to a terminal for every expression, pipeline, or object inspection.
Features
Evaluate the current line with Ctrl+Enter on Windows and Linux or Cmd+Enter on macOS.
Evaluate the current selection with Ctrl+Shift+Enter on Windows and Linux or Cmd+Shift+Enter on macOS.
Evaluate the full PowerShell document from the Command Palette.
Reuse a dedicated PowerShell session between evaluations instead of spawning a fresh shell every time.
Choose pwsh, powershell, or automatic engine detection.
Show the active or configured PowerShell engine in the status bar.
Restart the PowerShell session from the Command Palette or by clicking the status bar item.
Preserve multiple inline results in the same editor.
Render compact inline summaries for structured objects, hashtables, and collections.
Open a dedicated preview panel for larger or structured results.
Send expanded output and errors to a dedicated output channel.
Requirements
VS Code 1.99.0 or newer.
One of the following PowerShell engines available on your machine:
PowerShell 7 or newer via pwsh
Windows PowerShell 5.1 via powershell
Quick Start
Open a PowerShell file.
Place the cursor on a line or select a block of code.
Run Evaluate Current PowerShell Line or Evaluate PowerShell Selection.
Inspect the inline result, or open the preview panel for larger output.
Commands
PowerShell Inline Eval: Evaluate Current PowerShell Line