AI Agent Hub
Back to plugins
🖥️

dsh-pwsh-direct

Client Updated 2026.08.19

Run the following command in DeepSeek Harness:

dsh plugin install 0x1a27/dsh-pwsh-direct

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install 0x1a27/dsh-pwsh-direct in the DeepSeek Harness terminal to install this plugin; the source repository is https://github.com/0x1a27/dsh-pwsh-direct

About this plugin

Anyone running DSH Desktop on Windows has likely hit this frustrating bug: the built-in pwsh/shell tool returns a completely empty result. The command never executes, no files are created, no processes are spawned, and the GUI simply shows a blank or (no output). The root cause is that the DSH server is embedded in the Electron main process, and the sandbox runner uses the Electron executable as argv[0] without injecting ELECTRON_RUN_AS_NODE=1. Every spawn silently launches a second desktop instance, which loses its single-instance lock and kills itself, leaving behind zero output and zero side effects.

dsh-pwsh-direct tackles this problem in two layers. The first is a self-healing pass that runs on every DSH startup: it locates the dsh-subprocess-local copies in the install directory and across all profiles, then idempotently injects the missing ELECTRON_RUN_AS_NODE=1 line. After a restart, the built-in pwsh/shell works again, and if a DSH Desktop upgrade overwrites the patch, the next startup simply re-applies it without blocking DSH from starting. The second layer is the pwsh_direct fallback tool: during the window before a restart takes effect, it spawns a PowerShell executable directly with the DSH process privileges, completely bypassing the subprocess service layer. It ships with UTF-8 encoding fixes, process-tree timeout kills, an optional PowerShell pitfall gate, and output formatting identical to the built-in tool, so the model-side transition is virtually seamless.

This plugin is aimed at developers using the standard DSH Desktop install on Windows (Electron-embedded server with app.asar.unpacked), on Node 20 or later. It modifies only a handful of lines in a single dsh-subprocess-local file, makes no network calls, and emits no telemetry. If every dependency anchor fails to resolve, the plugin disables itself gracefully without interfering with DSH startup, making it a low-intrusion, fully reversible local fix.

Use Cases

  • Quick repair when the built-in pwsh/shell returns an empty result
  • Fallback execution during the window after a DSH Desktop upgrade wipes the patch
  • Automation flows that need to spawn PowerShell directly, bypassing the subprocess service layer

Best For

  • Developers running DSH Desktop in its standard form on Windows
  • DSH users hitting the empty-result bug in the built-in shell tool
  • Automation developers who need a direct PowerShell execution path