Title: bug(cli): squad.ps1 blocked by PowerShell execution policy on Windows · Issue #758 · github/squad · GitHub
Open Graph Title: bug(cli): squad.ps1 blocked by PowerShell execution policy on Windows · Issue #758 · github/squad
X Title: bug(cli): squad.ps1 blocked by PowerShell execution policy on Windows · Issue #758 · github/squad
Description: Bug Report Command: squad nap (affects all squad CLI commands on Windows) Error: File C:\Users\diberry\AppData\Roaming\npm\squad.ps1 cannot be loaded. The file C:\Users\diberry\AppData\Roaming\npm\squad.ps1 is not digitally signed. You c...
Open Graph Description: Bug Report Command: squad nap (affects all squad CLI commands on Windows) Error: File C:\Users\diberry\AppData\Roaming\npm\squad.ps1 cannot be loaded. The file C:\Users\diberry\AppData\Roaming\npm\...
X Description: Bug Report Command: squad nap (affects all squad CLI commands on Windows) Error: File C:\Users\diberry\AppData\Roaming\npm\squad.ps1 cannot be loaded. The file C:\Users\diberry\AppData\Roaming\npm\...
Opengraph URL: https://github.com/github/squad/issues/758
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug(cli): squad.ps1 blocked by PowerShell execution policy on Windows","articleBody":"## Bug Report\n\n**Command:** `squad nap` (affects all squad CLI commands on Windows)\n\n**Error:**\n```\nFile C:\\Users\\diberry\\AppData\\Roaming\\npm\\squad.ps1 cannot be loaded.\nThe file C:\\Users\\diberry\\AppData\\Roaming\\npm\\squad.ps1 is not digitally signed.\nYou cannot run this script on the current system.\n + CategoryInfo : SecurityError: (:) [], PSSecurityException\n + FullyQualifiedErrorId : UnauthorizedAccess\n```\n\n**Environment:**\n- OS: Windows 11\n- Shell: PowerShell (default execution policy: `Restricted` or `AllSigned`)\n- Node: v22.14.0\n- Install: `npm install -g @bradygaster/squad-cli`\n\n## Root Cause\n\nWhen npm installs a global package on Windows, it creates a `.ps1` shim script alongside the `.cmd` shim in `%APPDATA%\\npm\\`. PowerShell prefers `.ps1` over `.cmd`, so it tries to run `squad.ps1` — which is unsigned and blocked by default execution policy.\n\nThis affects any user who hasn't explicitly relaxed their PowerShell execution policy (`Set-ExecutionPolicy RemoteSigned`).\n\n## Workarounds (for users right now)\n\n1. **Use cmd.exe** instead of PowerShell — the `.cmd` shim works fine\n2. **Relax execution policy:** `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`\n3. **Delete the .ps1 shim:** `Remove-Item \\C:\\Users\\diberry\\AppData\\Roaming\\npm\\squad.ps1` — PowerShell falls back to `.cmd`\n4. **Use npx:** `npx @bradygaster/squad-cli nap` bypasses the shim entirely\n\n## Possible Fixes\n\n1. **Post-install script** that removes the `.ps1` shim on Windows (npm creates it automatically, can't prevent it)\n2. **Document the workaround** in README/installation guide\n3. **Sign the .ps1 script** with a code signing certificate (overkill for a CLI tool)\n4. **Recommend npx usage** in docs as the primary invocation method on Windows\n\n## Impact\n\n- **Severity:** Blocks ALL squad CLI usage on default Windows PowerShell\n- **Scope:** Any Windows user with default execution policy\n- **First-run experience:** Completely broken — user sees a security error on their first command\n\n## Reproduction\n\n1. Fresh Windows machine with default PowerShell execution policy\n2. `npm install -g @bradygaster/squad-cli`\n3. Open PowerShell\n4. Run `squad nap` (or any squad command)\n5. Observe: `PSSecurityException: UnauthorizedAccess`","author":{"url":"https://github.com/diberry","@type":"Person","name":"diberry"},"datePublished":"2026-04-02T20:27:06Z","url":"https://github.com/github/squad/issues/758"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:79dc0d26-8976-d403-1ddb-4219c811da54 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95EC:4279A:1DBB6C9:27FCAEC:6B017E09 |
| html-safe-nonce | 19c45e0a31656442a3698e63e2972dc2d59c9483c3bb59f0b048aaec36063d35 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUVDOjQyNzlBOjFEQkI2Qzk6MjdGQ0FFQzo2QjAxN0UwOSIsInZpc2l0b3JfaWQiOiI2Njg3OTM4MzcwMDU3ODk1NDMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7d595cc956d1813c0bce1052a897e883709d68629923f3f9570aad2310262ce5 |
| hovercard-subject-tag | issue:4196817738 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/squad/758/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d4842adba7dc3f3608f68644bca011c4a22c46ff7a852cda4bf37cd3115e2c4/github/squad/issues/758 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d4842adba7dc3f3608f68644bca011c4a22c46ff7a852cda4bf37cd3115e2c4/github/squad/issues/758 |
| og:image:alt | Bug Report Command: squad nap (affects all squad CLI commands on Windows) Error: File C:\Users\diberry\AppData\Roaming\npm\squad.ps1 cannot be loaded. The file C:\Users\diberry\AppData\Roaming\npm\... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | diberry |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/github/squad git https://github.com/github/squad.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 1151205052 |
| octolytics-dimension-repository_nwo | github/squad |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1151205052 |
| octolytics-dimension-repository_network_root_nwo | github/squad |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width