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.
- Evaluate the current line with
Ctrl+Enteron Windows and Linux orCmd+Enteron macOS. - Evaluate the current selection with
Ctrl+Shift+Enteron Windows and Linux orCmd+Shift+Enteron 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.
- VS Code
1.99.0or newer. - One of the following PowerShell engines available on your machine:
- PowerShell 7 or newer via
pwsh - Windows PowerShell 5.1 via
powershell
- PowerShell 7 or newer via
- Open a PowerShell file.
- Place the cursor on a line or select a block of code.
- Run
Evaluate Current PowerShell LineorEvaluate PowerShell Selection. - Inspect the inline result, or open the preview panel for larger output.
PowerShell Inline Eval: Evaluate Current PowerShell LinePowerShell Inline Eval: Evaluate PowerShell SelectionPowerShell Inline Eval: Evaluate PowerShell FilePowerShell Inline Eval: Restart PowerShell SessionPowerShell Inline Eval: Show PowerShell Session InfoPowerShell Inline Eval: Show Last PowerShell Result PreviewPowerShell Inline Eval: Clear Inline PowerShell Result
powershellContext.powerShellExecutable: Chooseauto,pwsh, orpowershell.powershellContext.preview.inlineMaxLength: Maximum inline preview length before truncation.powershellContext.preview.itemLimit: Maximum number of object properties or collection items shown in structured previews.powershellContext.preview.depth: Maximum nesting depth for structured previews.powershellContext.previewPanel.autoOpen: Control when the dedicated result preview panel opens automatically.powershellContext.outputChannel.autoOpen: Control when the output channel opens automatically.
npm install
npm run compile
npm testCreate a VSIX package locally:
npm install
npm run package:vsixRepository: https://github.com/srejv/powershell-inline-eval