Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 3, 2025

Description

Adds --skip-path (bash) / -SkipPath (PowerShell) option to all Aspire CLI installation scripts, enabling portable installations that don't modify PATH.

Scripts updated:

  • eng/scripts/get-aspire-cli.sh
  • eng/scripts/get-aspire-cli.ps1
  • eng/scripts/get-aspire-cli-pr.sh
  • eng/scripts/get-aspire-cli-pr.ps1

When enabled, skips:

  • Adding to system/user PATH environment variable
  • Modifying shell profile configs (bashrc/zshrc/fish)
  • Writing to GITHUB_PATH in CI
  • Updating current session PATH

Usage:

# Bash
./get-aspire-cli.sh --skip-path

# PowerShell
.\get-aspire-cli.ps1 -SkipPath

Fixes #9080

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Original prompt

This section details on the original issue you should resolve

<issue_title>Add option to exclude Aspire install path from Users PATH environment variable</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When installing Aspire using the install script, it adds the Aspire install path to the current environment and the current users system environment PATH. This prevents being able to install a 'portable' version of Aspire, similar to using the install script to install .NET instead of the installer.

Describe the solution you'd like

It would be nice if there was an option to not have the install path added to the system environment.

Additional context

No response</issue_description>

<agent_instructions>Add an option called --skip-path in the eng/scripts/get-aspire-cli*.sh and the equivalent for the ps1 scripts. This option should skip adding the aspire cli to PATH environment variable, and the shell.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@maddymontaquila @mitchdenny this is a good to have for 13.2 prob @davidfowl @radical

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add option to exclude Aspire install path from PATH variable Add --skip-path option to Aspire CLI installation scripts Dec 3, 2025
Copilot AI requested a review from radical December 3, 2025 22:36
Copilot finished work on behalf of radical December 3, 2025 22:36
@github-actions
Copy link
Contributor

github-actions bot commented Dec 4, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13317

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13317"

@radical radical marked this pull request as ready for review December 4, 2025 05:13
Copilot AI review requested due to automatic review settings December 4, 2025 05:13
@radical
Copy link
Member

radical commented Dec 4, 2025

Done. TODO: test locally

Copilot finished reviewing on behalf of radical December 4, 2025 05:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a --skip-path option to all Aspire CLI installation scripts, enabling portable installations that don't modify PATH environment variables.

Key changes:

  • Adds flag/parameter to skip PATH configuration in all four installation scripts (bash and PowerShell variants)
  • Wraps PATH update logic in conditional checks based on the new flag
  • Includes documentation and usage examples for the new option

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
eng/scripts/get-aspire-cli.sh Adds --skip-path flag and conditionally skips GitHub Actions PATH, shell profile updates, and current session PATH modifications
eng/scripts/get-aspire-cli.ps1 Adds -SkipPath parameter with help text and example, conditionally skips PATH environment updates
eng/scripts/get-aspire-cli-pr.sh Adds --skip-path flag for PR-specific installations with conditional PATH configuration logic
eng/scripts/get-aspire-cli-pr.ps1 Adds -SkipPath parameter with documentation and example for PR-based CLI installations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to exclude Aspire install path from Users PATH environment variable

2 participants