Skip to content

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

Merged
BYK merged 1 commit into
mainfrom
feat/install-ps1-handoff
Nov 29, 2026
Merged

BYK merged 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 <1421724+evanpurkhiser@users.noreply.github.com>
@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

@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 3 days. It closes in 2 days unless someone pushes, comments, or adds the WIP label.

@github-actions github-actions Bot added the Stale label Nov 29, 2026
@BYK
BYK marked this pull request as ready for review November 29, 2026 16:26
@BYK
BYK added this pull request to the merge queue Nov 29, 2026
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 29, 2026
Merged via the queue into main with commit bdfcd31 Nov 29, 2026
26 checks passed
@BYK
BYK deleted the feat/install-ps1-handoff branch November 29, 2026 16:31

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

risk: medium PR risk score: medium Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants