DeepSeek Harness Plugin

xinspark/dsh-win-pwsh7

Stars ★ 13 Downloads (30d) 8,858 Category Development & Runtime Added 2026-10-17 npm dsh-win-pwsh7

Reports which PowerShell the DSH pwsh executor actually runs (enabled rows only; version-numbered Store paths are never recommended as pins), and installs a Store-managed PowerShell 7 through a scripted Store-page click or the manual Store path. Allows the pwsh tool only when the live executor resolves PowerShell 7+, and when dsh-ops is installed keeps the native pwsh beside ops_bash by enabling Compatibility and hiding duplicate official tools. Native status card and configuration switch in the Web UI; Windows only, no runtime dependencies.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-win-pwsh7

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:xinspark/dsh-win-pwsh7

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

Give the Harness pwsh tool a real PowerShell 7 on Windows instead of silently falling back to Windows PowerShell 5.1.

  1. Detect PowerShell 7 on the machine (plus an optional overridePath);
  2. Validate an explicit path (pwsh7_status's path argument);
  3. Install via the script path (pwsh7_install opens the Microsoft Store page and clicks Install) or the manual path (Win+R, same Store link). There is no automatic startup install.

While enabled, the pwsh tool is allowed only when the live executor resolves to PowerShell 7+. Otherwise every call is denied by ctx.tools.guard before dispatch, the model is told to configure / install / disable, and no PowerShell process starts. Disabling the plugin removes the gate; the default executor then chooses the runtime itself, and the plugin still never writes pwshPath.

Verified environment

  • Windows 10/11.
  • Verified on DSH 0.2.2-rc.5 (see dsh.verifiedAgainst in package.json).
  • Supported range: >=0.2.1-rc.3 <0.3.0-0. Ending the range at the next prerelease makes the loader skip this bundle silently after every DSH patch release (no tools, no gate), so the upper bound follows the minor line.
  • The script path needs Microsoft Store; the manual path only needs the Store page.
  • No administrator rights are required.

Full documentation (Chinese) starts at docs/README.md; private maintainer material is not published. Relative documentation links may 404 on the npm package page — treat the GitHub repository as the source of truth.

What it does not do

  • It does not install anything at startup.
  • It does not write the executor's pwshPath; coexistence with dsh-ops is owned by dsh-ops 0.5.0+'s native "dsh-win-pwsh7 link", so this plugin writes no profile patch and hides no tools.
  • It does not uninstall a Store-installed PowerShell 7.
  • It does not auto-detect VPNs or preflight metered connections.

Coexistence with dsh-ops

Since 0.2.8 coexistence belongs to dsh-ops itself: dsh-ops 0.5.0+ detects this plugin and turns on its "dsh-win-pwsh7 link", keeping the native pwsh tool visible while ops_bash is still published; the official read / glob / grep tools are hidden by dsh-ops's own preset switches. This plugin no longer writes cordis.patch.yml, writes no compatibility override and masks no tools per agent.

dsh-ops 0.5.0 or newer is required. The old dshOpsCompat switch and dsh-ops-compat override were removed in 0.2.8; if an older version left a # dsh-win-pwsh7: ... (managed) block in the profile patch, delete it after upgrading. The link lives under "Other" on the dsh-ops plugin page; turning it off restores dsh-ops's own policy of hiding the host pwsh.

History: the 0.2.1 bridge planned from the post-restriction visible set, so it hid and restored the same tools in a loop and starved the Host main thread. 0.2.2 planned from the pre-restriction knownNames / restrictableNames. The whole bridge was removed in 0.2.8; the lesson remains in project experience.

Install this plugin

dsh plugin --profile desktop add github:XinSpark/dsh-win-pwsh7#v0.2.10
# or
dsh plugin --profile desktop add dsh-win-pwsh7

Restart DSH after installing. To wire a path, paste the exact profile patch printed by pwsh7_status into ~\.dsh\profiles\<profile>\cordis.patch.yml and restart; the plugin never writes the executor's pwshPath itself.

Two install paths

Path Behavior
Script install Call pwsh7_install. The tool first requires the user to confirm no VPN is active (vpnOffConfirmed: true). It then opens the Microsoft Store page for PowerShell 7, shows a notice (do not close the Store window; cancel if a VPN is on), and invokes the localized Install / Get / 获取 / 安装 button with Windows UI Automation.
Manual install Win+R → paste ms-windows-store://pdp/?ProductId=9MZ1SNWT0N5D → Enter → click Install. A manual install is detected automatically; no pin is needed.

If the Store page exposes no Install button within 90 seconds, the report asks the user to confirm the VPN first: disconnect it, fully quit and restart Microsoft Store, then retry or use the manual path.

Three-failure breaker

Within one Host process, after 3 consecutive failed script installs:

  • the next pwsh7_install starts no job;
  • it first asks the user to check the network, especially the VPN;
  • only after the user explicitly says it is fixed may the model call with userConfirmedFixed: true; that resets the counter and allows one retry;
  • three more failures open the breaker again;
  • otherwise the report points at the manual install.

The count lives in the current process and resets when DSH restarts.

Configuration

Key Default Meaning
overridePath unset Priority ① explicit pwsh.exe. It must spawn and report PowerShell 7+; a failed validation falls back to auto-detection. It only changes probing and recommendations, not executor wiring.

overridePath is volatile(): the plugin-page configuration section saves it live; it can also be set in the profile patch:

- id: win-pwsh7
  config:
    overridePath: 'D:\tools\pwsh\pwsh.exe'

Recommended companion

When the script install completes, its job verdict contains an instruction to the model: tell the user that dsh-win-pwsh7 works best paired with the dsh-ops plugin (https://github.com/T-Auto/dsh-ops); ask before installing it and never install it without the user's consent. Command:

dsh plugin --profile <profile> add dsh-ops

The recommendation appears only in the completed script-install result; pwsh7_status and manual installs do not advertise it repeatedly.

Report example

pwsh7_status returns the text report below; the plugin page renders the same state as a card rather than showing the whole report.

Executor rows:
  pwsh-sandbox : pwshPath = C:\Users\...\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe (PowerShell 7.6.9, Store family alias)

The pwsh tool currently runs on PowerShell 7.6.9 via the executor (…).
The executor resolves to the version-stable Store family alias: … Nothing to configure.

When nothing usable exists, the report ends with Three ways forward:: install / configure the executor / disable the plugin.

Plugin page

The status section is a native card showing the state, runtime and executor path, with Re-detect at the top right; the configuration section exposes only overridePath, with a "Choose..." button beside it: Desktop opens the system file dialog and the host path bridge fills in the absolute path of the selected pwsh.exe; an ordinary browser without that bridge asks you to type the path directly (the coexistence switch went away with the dsh-ops bridge and is managed on the dsh-ops page). The page ends with a one-line star request below the status card (⭐ in the localized copy); it adds no repository link because the footer already has one.

Languages

All plugin-owned copy follows the eight official DSH languages (zh / en / ja / de / es / fr / pt / ru) live. The UI dictionaries live in client.js (DICT_ZH / DICT_EN / DICT_JA / DICT_DE / DICT_ES / DICT_FR / DICT_PT / DICT_RU); the package title and description live in locale/*.json, one file per language.

  • Chinese and English are hand-written; ja / de / es / fr / pt / ru are machine translation (lightly proofread), so some phrasing may read unnaturally — corrections are welcome.
  • Changing the package title/description in locale/*.json needs a DSH restart: the Host reads that metadata at boot, so a page refresh does not pick it up. UI dictionaries in client.js apply on refresh.
  • New copy must be added to all eight dictionaries; the client gate in npm run check enforces identical key sets, non-empty values, no CJK in en, and the eight locale metas.

Windows UTF-8 console (removed in 0.3.0)

0.2.5 – 0.2.12 carried a transitional layer: it wrapped the same ctx.shell.execute the pwsh tool uses and prefixed every Windows command with chcp.com 65001 > $null;, so a nested pwsh -File / powershell -File could not inherit console code page 936, emit GBK, and be decoded as � by the collector.

0.3.0 removed it, based on a measurement on DSH 0.2.2-rc.5: with the layer off (chcp reports 936), the Host's own ENCODING_PREAMBLE ([Console]::OutputEncoding = UTF8) already gets nested output to the collector as UTF-8:

Case (no layer, console at 936) Result
powershell -NoProfile -Command "Write-Output '嵌套中文测试'" correct
ASCII-only script building Chinese from [char], powershell -File correct
UTF-8 script with BOM, powershell -File correct
both scripts through nested pwsh -File correct

⚠️ A neighbouring problem that is easy to confuse with this one: a UTF-8 .ps1 without a BOM is read by Windows PowerShell 5.1 as code page 936, and the Chinese inside it turns into mojibake such as 宓屽涓枃娴嬭瘯. That is a script file encoding problem, not an output decoding problem — write the script with a BOM (Set-Content -Encoding utf8BOM) or stay on pwsh 7. This plugin no longer takes part in either.

The utf8Console config key went with it. If an old profile's cordis.patch.yml still sets it, the upgrade reports an unknown config key — delete that line.

Disable or uninstall

Disabling the plugin removes the pwsh gate and the plugin page; it does not uninstall PowerShell 7. As long as pwsh.exe remains on the machine, the default executor still prefers it (normally the Store build); Windows PowerShell 5.1 is used only when no pwsh.exe can be found. To truly return to 5.1, uninstall the Store build or pin the executor to powershell.exe (not recommended).

Troubleshooting

Symptom What to do
The Store page opens without an Install button Confirm the VPN is off, fully quit and restart Microsoft Store, then retry; or use the manual path.
pwsh still runs 5.1 Run pwsh7_status, paste the reported pwshPath patch into the profile, and restart; or install the Store build.
The plugin page is missing Confirm dsh-win-pwsh7 is enabled in the current profile, then restart DSH.
Chinese turns into � when a command nests pwsh Since 0.3.0 this plugin no longer touches encoding: the Host's ENCODING_PREAMBLE is enough. Upgrade to 0.3.0 first; if it persists, check whether the script file has no BOM and is being read as 936 by 5.1 (see the section above).

Verification

$env:DSH_APP_DIR = '<install root>'        # or resources/app / resources/app.asar
node tools/check-host.mjs
node tools/check-client.mjs
node tools/check-native-contracts.mjs
node tools/check-docs.mjs
node tools/reconcile-build.mjs --from <previously verified kernel build>   # needs the network

All four gates run offline; host / native need DSH_APP_DIR (install root, resources/app, or resources/app.asar), while client / docs do not need an installation. reconcile-build answers a different question — how much moved between two builds: it compares the npm tarballs of both builds file by file, so after an upgrade it decides whether a port is needed before the gates confirm the contracts still behave. It needs the network, which is why it is not in the gate chain. Coverage and the pre-release manual checklist are in docs/testing.md.

Documentation

I want to… Read
Configure the two keys Configuration
Fix a problem Troubleshooting
Understand detection / gate / bridges Design
Check the upstream contracts Native contracts
Reconcile a DSH upgrade Version compatibility
Run the gates and the manual checklist Acceptance record
Review past pitfalls Project experience
Maintain and release MAINTAINING.md

Design constraints

  • The reading comes from the executor's own ctx.shell.pwshPath, not from config rows; overridePath only changes probing and recommendations.
  • No VPN auto-detection and no metered-connection preflight: the user confirms the VPN before an install, and a page-load failure asks again.
  • No automatic retries; the three-failure breaker ends the loop.
  • Run all five gates before publishing; end-to-end installation is release evidence, not part of the automated gate.

License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.