@@ -127,7 +127,7 @@ $Script:Config = @{
127
127
$InvokedFromFile = -not [string ]::IsNullOrEmpty($PSCommandPath )
128
128
129
129
# =============================================================================
130
- # START: Code shared with get-aspire-cli-pr.ps1
130
+ # START: Shared code
131
131
# =============================================================================
132
132
133
133
# Consolidated output function with fallback for platforms that don't support Write-Host
@@ -422,24 +422,10 @@ function Expand-AspireCliArchive {
422
422
}
423
423
424
424
# Simplified installation path determination
425
- function Get-InstallPath {
425
+ function Get-DefaultInstallPrefix {
426
426
[CmdletBinding ()]
427
427
[OutputType ([string ])]
428
- param (
429
- [Parameter ()]
430
- [string ]$InstallPath
431
- )
432
-
433
- if (-not [string ]::IsNullOrWhiteSpace($InstallPath )) {
434
- # Validate that the path is not just whitespace and can be created
435
- try {
436
- $resolvedPath = [System.IO.Path ]::GetFullPath($InstallPath )
437
- return $resolvedPath
438
- }
439
- catch {
440
- throw " Invalid installation path: $InstallPath - $ ( $_.Exception.Message ) "
441
- }
442
- }
428
+ param ()
443
429
444
430
# Get home directory cross-platform
445
431
$homeDirectory = Invoke-WithPowerShellVersion - ModernAction {
@@ -466,7 +452,7 @@ function Get-InstallPath {
466
452
throw " Unable to determine user home directory. Please specify -InstallPath parameter."
467
453
}
468
454
469
- $defaultPath = Join-Path $homeDirectory ( Join-Path " .aspire" " bin " )
455
+ $defaultPath = Join-Path $homeDirectory " .aspire"
470
456
return [System.IO.Path ]::GetFullPath($defaultPath )
471
457
}
472
458
@@ -594,9 +580,33 @@ function Remove-TempDirectory {
594
580
}
595
581
596
582
# =============================================================================
597
- # END: Code shared with get-aspire-cli-pr.ps1
583
+ # END: Shared code
598
584
# =============================================================================
599
585
586
+ # Simplified installation path determination
587
+ function Get-InstallPath {
588
+ [CmdletBinding ()]
589
+ [OutputType ([string ])]
590
+ param (
591
+ [Parameter ()]
592
+ [string ]$InstallPath
593
+ )
594
+
595
+ if (-not [string ]::IsNullOrWhiteSpace($InstallPath )) {
596
+ # Validate that the path is not just whitespace and can be created
597
+ try {
598
+ $resolvedPath = [System.IO.Path ]::GetFullPath($InstallPath )
599
+ return $resolvedPath
600
+ }
601
+ catch {
602
+ throw " Invalid installation path: $InstallPath - $ ( $_.Exception.Message ) "
603
+ }
604
+ }
605
+
606
+ $defaultPath = Join-Path (Get-DefaultInstallPrefix ) " bin"
607
+ return [System.IO.Path ]::GetFullPath($defaultPath )
608
+ }
609
+
600
610
function Get-ContentTypeFromUri {
601
611
[CmdletBinding ()]
602
612
[OutputType ([string ])]
0 commit comments