Preface

When using DeepSeek Harness (DSH) on Windows, the shell in conversations is often mounted as the pwsh-sandbox executor. In some environments, the resolved executable remains Windows PowerShell 5.1 instead of PowerShell 7 (pwsh.exe, major version ≥ 7). When models write commands following bash or POSIX conventions, the syntax differences between 5.1 and 7, as well as denial and failure classifications under sandbox policies, can increase troubleshooting costs.

dsh-plugin-pwsh7 is a client-side bundle published by maintainer drliuhuan: it retains the sandbox mode, sandbox_permissions escalation, background tasks, and output limits of the official dsh-pwsh-sandbox, only replacing the executable resolution logic, while providing installation, route switching, and self-diagnosis capabilities in the Web GUI. The following sections describe its positioning, features, installation, and usage.

What is this

dsh-plugin-pwsh7 (the npm package name is the same as the plugin repository name) targets Windows 10/11 and requires a DSH profile that supports bundles (e.g., @deepseek-ai/dsh-base / Web profile). The README notes that it has been verified on DSH desktop 0.2.1-rc.2.

The plugin takes over the pwsh-sandbox slot via a Cordis patch: if config.pwshPath is explicitly configured, it remains authoritative; otherwise, it uses the PowerShell 7 resolved by the plugin. If PowerShell 7 is not installed on the local machine, it will not be automatically installed by the model; instead, the Web GUI will pop up a setup dialog, or the user can operate via Settings → PowerShell 7, or manually install the system version of PowerShell 7.

Community directory page: drliuhuan/dsh-plugin-pwsh7. Source code and documentation: GitHub Repository. The release version mentioned in current materials is 0.3.3, license MIT.

Core Features

Executor and Sandbox

The executor class RouterPwshExecutor inherits from the official SandboxPwshExecutor (bundle ID is pwsh7-executor). Apart from pwshPath resolution, it is consistent with the stock executor regarding sandbox mode, permission escalation, denial/runner-failure facts, background jobs, output limits, and exit markers.

shell_router Tool

When PowerShell 7 is missing or needs diagnosis, the model can call the user-facing shell_router tool (registered by the bundle line dsh-plugin-pwsh7):

Action Description
status (default) Resolved PowerShell 7 path and version, config file, current sandbox policy, and bundled resolution results.
diagnose Runs real PowerShell 7 commands (version detection and workspace writes) under the current sandbox policy, reporting exit codes, stdout/stderr, and denial/runner-failure classifications with hints.
selfcheck Same read-only self-check as the settings page, returning ok / warn / fail lines.
route Persists route: "plugin" or route: "system" and reports the new route.
uninstall Removes the plugin-managed per-user portable installation (files, temp directory, managed PATH entries), retaining route preferences.
install, relocate Not executed by the tool; returns instructions requiring the user to complete via the setup dialog, Settings → PowerShell 7, or manual installation.

Web GUI: Settings Page and Installation Dialog

The browser side registers the PowerShell 7 settings page (settings.section). Readable states include: resolved version and executable path, installation directory, configuration path, installation scope and method, plugin version, and whether it is plugin-managed and uninstallable.

Actionable items include: switching the route between “Plugin-managed PowerShell 7” and “System default”; self-checking the entire route stack; uninstalling the plugin-managed per-user installation; migrating the per-user installation to system-wide.

When PowerShell 7 is missing, both page loading and every failed pwsh run will open the setup dialog, providing a download button and real-time progress (bytes, percentage, phase). Closing the dialog does not cancel the ongoing installation; the next failed run will reopen it.

Dialect Hints and Composer Chip

The model-facing Prompt guidance is optional and off by default (upgrades will not automatically consume prompt tokens). In the setup dialog and Settings → PowerShell 7 → Prompt guidance, two levels can be selected. The option is written to dialect in config.json and takes effect on the next model request without restarting DSH:

  • Common guidance: Explains that pwsh is PowerShell 7, lists syntax easily confused with bash and how to replace them; approximately 1,337 characters.
  • Force PowerShell 7 mode: Based on common guidance, replaces commands with PowerShell equivalents even if the user explicitly names POSIX tools; adds approximately (README total is on the order of 1,442 characters).

The README records that on 12 tasks prone to inducing bash usage (5 samples per task), the accuracy rate was about 38–42% without guidance, and about 98% with both levels enabled; for standard expressions, both groups achieved 100%.

The Web client injects a pwsh7 chip into conversation.input.right, where three status levels correspond to gray/blue/green borders; switching levels will prompt that the prompt cache may be cleared, and upon confirmation, it issues POST /pwsh7/dialect. The chip polls /pwsh7/state every 15 seconds.

When a command fails, the executor appends an actionable [pwsh7] hint line to the end of stderr (mapping common POSIX names to PowerShell 7 cmdlets on parse errors or “command not recognized”), without changing the exit code and only appending once per settled result.

Installation and Activation

Install the bundle from npm via the DSH plugin manager (command from original text):

plugin_manager action=install_bundle target=dsh-plugin-pwsh7@0.3.3

Local development directory installation (will link to that directory):

plugin_manager action=install_bundle target=D:\path\to\dsh-plugin-pwsh7

After installation, the bundle takes effect immediately via HMR; modifying plugin source code requires restarting DSH to load new module generations. Running the repository test suite requires Node.js >= 22 (development/testing only).

Typical Usage

  1. After installing the bundle, let the model use the pwsh tool as usual on Windows; if PowerShell 7 is resolved, commands are executed by version 7 under the original sandbox policy.
  2. When troubleshooting routing or sandbox issues, let the model call shell_router, e.g., default status, or diagnose to view actual execution results under the current policy.
  3. To fix the route to use the system installation or the plugin-managed copy, switch via the settings page or shell_router’s route; use uninstall or the corresponding action on the settings page to remove the plugin-managed copy.
  4. If the team frequently encounters models writing bash syntax, enable Prompt guidance via the settings page or Composer chip; note token costs and cache behavior.

Installation of PowerShell 7 itself is always confirmed by the user in the GUI; do not rely on the install action of shell_router (that action only returns instructions).

Applicable Scenarios and Notes

Suitable for: Developers using DSH Web / desktop profiles on Windows who want ctx.shell to stably resolve to PowerShell 7 and need to manage per-user portable installations, system routes, and self-diagnostics in the GUI.

Notes:

  • Windows only; this bundle is not needed for non-Windows environments.
  • The plugin and DSH run with current process privileges; before installing from npm or a directory, you should review the repository source code and MIT license to ensure compliance with your security and compliance requirements.
  • SkillHub and other community directories are independent sites and have no official affiliation with DeepSeek / High-Flyer; stars and categories are subject to the directory page display (GitHub 3 stars in materials, category Client).

Conclusion

Without significantly altering the DSH sandbox execution model, dsh-plugin-pwsh7 locks the model-facing pwsh tool to PowerShell 7 and places installation, routing, and diagnostics on top of a user-controllable Web interface and shell_router. For further details on parameters and changelogs, please read the repository README and Chinese Documentation.

  • Directory Page: https://www.skillhub.cn/plugins/drliuhuan/dsh-plugin-pwsh7
  • GitHub: https://github.com/drliuhuan/dsh-plugin-pwsh7