Preface¶
When using DeepSeek Harness (DSH) on Windows, the Desktop adapter resolves PowerShell executables in a fixed order: it first checks C:\Program Files\PowerShell\7\pwsh.exe, then scans PATH (where the Microsoft Store version often appears via execution aliases), and finally falls back to C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe (Windows PowerShell 5.1). If PowerShell 7 is not properly installed on the machine, Harness silently falls back to 5.1; in 5.1, && and || are parse errors, so chained commands written by the model often fail before execution. Manually installing the MSI or using a non-Store WinGet source can easily get entangled with “self-update,” metered networks, and executor path resolution.
The following introduces the community plugin dsh-win-pwsh7 (maintainer xinspark): on Windows it detects and validates the path for the Harness pwsh tool, and — when you explicitly request it — installs self-updating PowerShell 7 via the Microsoft Store, checking before installation whether the connection is metered. It does not bundle PowerShell itself, nor does it automatically modify your executor configuration; installation is always an explicit action.
What Is This¶
dsh-win-pwsh7 is a client-side class plugin in the DSH ecosystem (pure JavaScript, zero runtime dependencies, meaningful only on Windows). In one sentence: it hands a real PowerShell 7 to the Harness pwsh tool on Windows, instead of defaulting to a fallback to 5.1.
The plugin does three things:
- Detect local PowerShell 7 (including the
overridePathin configuration); - Validate the path you pass in (the
pathparameter ofpwsh7_status); - Install: only from the Microsoft Store (
pwsh7_install, or the configinstallIfMissing) — this is the only installation route, and it checks connection cost before acting.
It does not uninstall anything; removing the plugin will not touch your already-installed PowerShell.
Why a Separate Plugin Is Needed¶
The Desktop adapter’s resolution order in Harness determines that when no usable PowerShell 7 is available, the final step is always 5.1. For the agent, whether the current version is 7 or 5.1 directly determines whether && / || can be written into a single command. The Store MSIX runtime usually does not appear in C:\Program Files\PowerShell\7\, and the executor will not “find” the alias by itself — you often need to write the entire profile patch given in the report into ~\.dsh\profiles\<profile>\cordis.patch.yml and restart. This plugin is responsible for reading the runtime, giving a paste-able pin patch, and informing the model through the hint segment whether the current operators are usable (the hint segment goes through DSH’s existing mechanism, rather than re-registering a pwsh tool schema).
Core Features¶
Two Tools¶
pwsh7_status [path] Report what is currently running; validate the path; give a paste-able pin patch
pwsh7_install Install from the Microsoft Store, running as a background job and immediately returning the job number
pwsh7_status: no side effects, suitable for checking the runtime after installing the plugin or in the plugin page.pwsh7_install: has side effects; if a regular PowerShell 7 already exists or a usable Store alias is available, it reports “already in place.” Use the platform’s built-injob_outputto view progress andjob_killto stop. Installation is registered inctx.jobs(kindpwsh7), avoiding blocking waits on winget/Store queues.
In terms of installation implementation, the plugin executes in the background:
winget install --id 9MZ1SNWT0N5D --source msstore
(Corresponding to Microsoft Store entry.) The README explicitly states there is no second installer route; WinGet non-Store MSI/MSIX and other approaches were rejected during development and are not options.
Metered Connections and Pre-installation Checks¶
Windows will delay Store downloads on “metered connections.” Before installation, the plugin uses Windows PowerShell 5.1 to read the connection cost via WinRT; if it hits a metered connection, it names the network and the remedy is to turn off “metered connection” for that WLAN and retry, rather than switching installers. If the cost cannot be read, it stays completely silent and does not guess.
winget exit codes do not necessarily indicate success or failure: after winget exits, the plugin performs bounded re-probes (8 times × 15 seconds), and the verdict is based on whether the runtime is in place.
Pin-able Path Forms¶
The report distinguishes “family aliases,” “root aliases,” and versioned WindowsApps directories. The first two are suitable for pinning across Store updates; versioned directories move with each update, and the pin silently becomes invalid. Residual risk: package activation mechanisms are not fully documented, aliases are “works today” pins, not a contract — the report states this explicitly, and pwsh7_install is the way out when the pin fails.
Optional Configuration¶
| Key | Default | Description |
|---|---|---|
overridePath |
Unset | The highest-priority explicit pwsh.exe, must be able to start and report PowerShell 7+; if validation fails, fall back to auto-detection |
installIfMissing |
false |
If no usable PowerShell 7 is available at startup, install in the background (equivalent to pwsh7_install), results are written to the status report |
Both are volatile(): changes made and saved in the plugin page take effect immediately, no restart needed. They can also be written into a profile patch:
- id: win-pwsh7
config:
overridePath: 'D:\tools\pwsh\pwsh.exe'
installIfMissing: true
Installation and Activation¶
Install from GitHub (the README recommends locking to a tag):
dsh plugin --profile desktop add github:XinSpark/dsh-win-pwsh7#v0.12.1
Replace desktop with the profile you actually use (dsh plugin list can show them).
Other methods:
- npm:
dsh plugin --profile desktop add dsh-win-pwsh7(ornpm i dsh-win-pwsh7) - Local development:
npm pack, thendsh plugin --profile desktop add file:<absolute path to generated .tgz>
After installation, restart DSH. When wiring is needed, paste the pwsh7_status or the entire profile patch from the plugin page report into ~\.dsh\profiles\<profile>\cordis.patch.yml and restart. The plugin will not modify the executor’s pwshPath for you; this is a deliberate design decision.
If you do not need PowerShell 7 on this machine, you can turn off this plugin in the plugin page (recommended to stop both tools); note that after turning it off, the pwsh tool may still fail due to the executor’s fixed path — this is a trade-off of pwsh itself.
Typical Usage¶
- Install the plugin and restart DSH.
- In the plugin page or by having the model call
pwsh7_status, confirm whether the current version is PowerShell 7 or has fallen back to 5.1, and whether a patch is needed. - If there is no PowerShell 7 and you confirm you want to install: call
pwsh7_install(or enableinstallIfMissing), track the job withjob_output; if a metered connection is indicated, change the network settings first and then retry. - Write the cordis patch from the report into the corresponding profile’s
cordis.patch.yml, restart, and then usepwshto verify whether the&&/||behavior meets expectations.
Example hint segment (when the machine has pinned PowerShell 7, the gist is as follows):
The `pwsh` tool on this machine runs PowerShell 7.6.6, so `&&` and `||` work in one command.
When pinned to 5.1 or when 7 does not exist, the same mechanism will explain that ; should be used for chaining, or the two paths when the pin path does not exist (Store installation / disable the plugin).
Applicable Scenarios and Notes¶
Who it suits: developers using DSH Desktop on Windows, relying on pwsh to run scripts, and hoping PowerShell 7 comes from a Store self-updating package whose path can be detected and pinned.
Permissions and security: the plugin runs with the current DSH process permissions; pwsh7_install will trigger winget/Store installation behavior. Before installing, you should read the source code of the GitHub repository and the MIT license, and judge on your own whether to trust the maintainer xinspark.
Ecosystem notes: DSH advocates “everything is a plugin”; the SkillHub directory page is a community-curated site and has no official affiliation with DeepSeek / 幻方 (Huanfang).
Version: the repository’s package.json current version is 0.12.3; the tag v0.12.1 in the installation example is based on the README installation section, and other tags can be locked as needed. The GitHub star count is based on the directory page (recorded as 1).
Conclusion¶
dsh-win-pwsh7 narrows the gap between Harness pwsh and PowerShell 7 on Windows into an observable, verifiable, explicitly installable Store route, and writes real-world pitfalls such as metered networks, winget exit codes, and alias pins into its behavior. When PowerShell 7 is not needed, just turn off the plugin; when needed, first run pwsh7_status, then decide whether to pwsh7_install and paste the patch.
- Directory page: https://www.skillhub.cn/plugins/xinspark/dsh-win-pwsh7
- GitHub: https://github.com/xinspark/dsh-win-pwsh7