Skip to content

feat(cli-docs): Serve /install.ps1/<handoff code> with SENTRY_HANDOFF set - #2429

Draft
sentry-junior[bot] wants to merge 1 commit into
mainfrom
feat/install-ps1-handoff
Draft

sentry-junior[bot] wants to merge 1 commit into
mainfrom
feat/install-ps1-handoff

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2354, which added this only for bash. Windows now gets the same one-liner: irm https://cli.sentry.dev/install.ps1/sntryh_… | iex.

One Edge Function now serves both scripts. The route ^/(install|install\.ps1)/(<code>)$ rewrites to /install-handoff?script=$1&code=$2. The handler returns 404 for any other script name, and it still accepts only codes that match HANDOFF_CODE. install.ps1 already passes SENTRY_HANDOFF to sentry cli setup, so the script itself doesn't change.

PowerShell differs from bash in one way. curl | bash runs in a child process, so the export goes away when the install ends. iex runs in the caller's session, so $env:SENTRY_HANDOFF would stay set afterwards. To prevent that, the PowerShell response sets the variable, wraps the script in try { … } finally { Remove-Item Env:SENTRY_HANDOFF }, and so clears it even when the install throws. Wrapping is safe because install.ps1 has no param, using, or #Requires statement that must come first. Plain /install and /install.ps1 don't change.

Open questions

via @evanpurkhiser.

--

View Session [Sentry]

… set

Windows gets the same one-liner as bash:
irm https://cli.sentry.dev/install.ps1/<code> | iex

The handoff function now serves both install scripts. Because iex runs
in the caller's session, the PowerShell variant clears SENTRY_HANDOFF in
a finally block once the install ends.

Co-Authored-By: Evan Purkhiser <[email protected]>
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 19, 2026 4:59pm UTC
sentry-local Ready Ready Preview Nov 19, 2026 4:59pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview – sentry-local — b7ca29b4 Deployed Nov 19, 2026 by vercel[bot]
Preview – cli — b7ca29b4 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant