fix(cli): detect and warn about unsigned .ps1 shim on Windows#760
Closed
fix(cli): detect and warn about unsigned .ps1 shim on Windows#760
Conversation
Closes #758 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Windows-specific diagnostic to squad doctor to detect the unsigned squad.ps1 shim created by npm global installs (which PowerShell may block), plus documentation and an optional removal helper script.
Changes:
- Add
checkWindowsPs1Shim()todoctorand surface it as a warning whensquad.ps1is found. - Add unit tests for the new Windows shim detection logic.
- Document the PowerShell workaround and ship an optional script to remove the
.ps1shim.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
packages/squad-cli/src/cli/commands/doctor.ts |
Adds checkWindowsPs1Shim() and wires it into runDoctor() results. |
test/cli/doctor.test.ts |
Adds unit tests for Windows .ps1 shim detection and adjusts an existing count assertion. |
README.md |
Documents the PowerShell execution policy symptom and the Remove-Item workaround. |
packages/squad-cli/scripts/remove-ps1-shim.mjs |
Adds an optional script to delete squad.ps1 so PowerShell falls back to squad.cmd. |
.changeset/fix-ps-execution-policy.md |
Publishes a patch changeset for the CLI. |
Ensures that both doctor.ts and remove-ps1-shim.mjs guard against relative paths when npm_config_prefix and APPDATA environment variables are not set. This prevents unintended file operations on relative paths. Closes #758 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #758
What
Why
npm global install creates unsigned .ps1 shim that PowerShell blocks with default execution policy. This breaks ALL squad CLI commands on default Windows.
Changes
Working as Network (Distribution)