citydirector/dsh-pwsh-plugin
A pwsh_run tool that pipes PowerShell script text to a persistent pwsh 7 process over stdin, so variables, modules and location survive between calls.
Fixes two concrete PowerShell problems in one move. Wrapping a command in bash -c expands dollar signs before PowerShell ever sees them and kills here-documents in the same layer; the built-in pwsh tool passes them correctly but starts a brand-new process each call and rides the Windows command line, where the author measured 32,700 characters producing a spawn error. This tool sends the script body as a base64 blob on stdin, so nothing is escaped in transit, there is no command-line length cap (91,741 characters verified in a single call), the roughly 400 ms cold start is paid once, and variables, working location and loaded modules persist from one call to the next. The README documents the measurements and the reasoning behind each design choice in FINDINGS.md.
Install
dsh plugin --profile desktop add 'github:citydirector/dsh-pwsh-plugin#v0.1.1'The package is a DSH bundle that ships its own cordis.patch.yml, so installing is all you do — you never edit the profile by hand. The README gives a sidebar path (Plugins → Add plugin → the repository URL, then switch it on) and the CLI form shown here, which must be run through the desktop application's own CLI because the desktop profile can only be managed that way; the README shows setting DSH_HOME to the data root the desktop app itself uses. Verify with --dump-config on a non-reserved profile, where the row appears as - id: pwsh-run followed by its name.
Compatibility
DSH 0.2.0-rc.2 or newer (the author tested 0.2.0-rc.2 and 0.2.1-rc.2) plus PowerShell 7. It sits next to the built-in pwsh tool and does not replace it. The same repository also carries a small C shim in the wsl directory that gives the bash tool a real write boundary inside WSL.
Details
- Repo: citydirector/dsh-pwsh-plugin
- Category: Tools & Capabilities
- Stars: 0
- Version: 0.1.1 (pinned GitHub tag)
Alternatives
jackie-cqz/dsh-jev-plugin · tigerfsh/dsh-plugin-taobao · sakthiveltofficial/dsh-shopify-plugins