|
17 | 17 | Pass a specific version to get CLI for that version.
|
18 | 18 |
|
19 | 19 | .PARAMETER InstallPath
|
20 |
| - Directory prefix to install (default: %USERPROFILE%\.aspire on Windows, $HOME/.aspire on Unix) |
21 |
| - CLI will be installed to InstallPath\bin (or InstallPath/bin on Unix) |
| 20 | + Directory to install the CLI (default: %USERPROFILE%\.aspire\bin on Windows, `$HOME/.aspire/bin on Unix) |
22 | 21 |
|
23 | 22 | .PARAMETER Version
|
24 | 23 | Version of the Aspire CLI to download (default: unset)
|
|
61 | 60 | iex "& { $(irm https://aka.ms/aspire/get/install.ps1) }"
|
62 | 61 |
|
63 | 62 | .EXAMPLE
|
| 63 | + # Piped execution |
64 | 64 | iex "& { $(irm https://aka.ms/aspire/get/install.ps1) } -Quality staging"
|
65 | 65 |
|
66 | 66 | .NOTES
|
|
77 | 77 |
|
78 | 78 | [CmdletBinding(SupportsShouldProcess)]
|
79 | 79 | param(
|
80 |
| - [Parameter(HelpMessage = "Directory prefix to install")] |
| 80 | + [Parameter(HelpMessage = "Directory to install the CLI")] |
81 | 81 | [string]$InstallPath = "",
|
82 | 82 |
|
83 | 83 | [Parameter(HelpMessage = "Version of the Aspire CLI to download")]
|
@@ -422,22 +422,22 @@ function Expand-AspireCliArchive {
|
422 | 422 | }
|
423 | 423 |
|
424 | 424 | # Simplified installation path determination
|
425 |
| -function Get-InstallPrefix { |
| 425 | +function Get-InstallPath { |
426 | 426 | [CmdletBinding()]
|
427 | 427 | [OutputType([string])]
|
428 | 428 | param(
|
429 | 429 | [Parameter()]
|
430 |
| - [string]$InstallPrefix |
| 430 | + [string]$InstallPath |
431 | 431 | )
|
432 | 432 |
|
433 |
| - if (-not [string]::IsNullOrWhiteSpace($InstallPrefix)) { |
| 433 | + if (-not [string]::IsNullOrWhiteSpace($InstallPath)) { |
434 | 434 | # Validate that the path is not just whitespace and can be created
|
435 | 435 | try {
|
436 |
| - $resolvedPath = [System.IO.Path]::GetFullPath($InstallPrefix) |
| 436 | + $resolvedPath = [System.IO.Path]::GetFullPath($InstallPath) |
437 | 437 | return $resolvedPath
|
438 | 438 | }
|
439 | 439 | catch {
|
440 |
| - throw "Invalid installation path: $InstallPrefix - $($_.Exception.Message)" |
| 440 | + throw "Invalid installation path: $InstallPath - $($_.Exception.Message)" |
441 | 441 | }
|
442 | 442 | }
|
443 | 443 |
|
@@ -918,31 +918,28 @@ function Start-AspireCliInstallation {
|
918 | 918 | }
|
919 | 919 |
|
920 | 920 | # Determine the installation path
|
921 |
| - $resolvedInstallPrefix = Get-InstallPrefix -InstallPrefix $InstallPath |
| 921 | + $resolvedInstallPath = Get-InstallPath -InstallPath $InstallPath |
922 | 922 |
|
923 | 923 | # Ensure the installation directory exists
|
924 |
| - if (-not (Test-Path $resolvedInstallPrefix)) { |
925 |
| - Write-Message "Creating installation directory: $resolvedInstallPrefix" -Level Info |
926 |
| - if ($PSCmdlet.ShouldProcess($resolvedInstallPrefix, "Create installation directory")) { |
| 924 | + if (-not (Test-Path $resolvedInstallPath)) { |
| 925 | + Write-Message "Creating installation directory: $resolvedInstallPath" -Level Info |
| 926 | + if ($PSCmdlet.ShouldProcess($resolvedInstallPath, "Create installation directory")) { |
927 | 927 | try {
|
928 |
| - New-Item -ItemType Directory -Path $resolvedInstallPrefix -Force | Out-Null |
| 928 | + New-Item -ItemType Directory -Path $resolvedInstallPath -Force | Out-Null |
929 | 929 | }
|
930 | 930 | catch {
|
931 |
| - throw "Failed to create installation directory: $resolvedInstallPrefix - $($_.Exception.Message)" |
| 931 | + throw "Failed to create installation directory: $resolvedInstallPath - $($_.Exception.Message)" |
932 | 932 | }
|
933 | 933 | }
|
934 | 934 | }
|
935 | 935 |
|
936 |
| - # Set CLI installation path |
937 |
| - $cliBinDir = Join-Path $resolvedInstallPrefix "bin" |
938 |
| - |
939 | 936 | $rid = Get-RuntimeIdentifier -_OS $OS -_Architecture $Architecture
|
940 | 937 |
|
941 | 938 | # Download and install the Aspire CLI
|
942 |
| - Install-AspireCli -CliBinDir $cliBinDir -Version $Version -Quality $Quality -TargetRID $rid |
| 939 | + Install-AspireCli -CliBinDir $resolvedInstallPath -Version $Version -Quality $Quality -TargetRID $rid |
943 | 940 |
|
944 | 941 | # Update PATH environment variables
|
945 |
| - Update-PathEnvironment -CliBinDir $cliBinDir |
| 942 | + Update-PathEnvironment -CliBinDir $resolvedInstallPath |
946 | 943 | }
|
947 | 944 | catch {
|
948 | 945 | # Log the full exception details if verbose
|
|
0 commit comments