Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions eng/scripts/get-aspire-cli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,12 @@ function Expand-AspireCliArchive {
if (-not (Get-Command Expand-Archive -ErrorAction SilentlyContinue)) {
throw "Expand-Archive cmdlet not found. Please use PowerShell 5.0 or later to extract ZIP files."
}

Expand-Archive -Path $ArchiveFile -DestinationPath $DestinationPath -Force -ErrorAction Stop

Invoke-WithPowerShellVersion -ModernAction {
Expand-Archive -Path $ArchiveFile -OutputPath $DestinationPath -Force -ErrorAction Stop
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

The ModernAction uses Expand-Archive -OutputPath, but elsewhere in this script (e.g., extension extraction) Expand-Archive is invoked with -DestinationPath under $Script:IsModernPowerShell. This inconsistency strongly suggests -OutputPath is not a valid parameter for the Expand-Archive available in pwsh, and will cause Windows installs under PowerShell Core to fail. Prefer keeping -DestinationPath for both branches, or (more robustly) select the parameter name by checking Get-Command Expand-Archive.Parameters for DestinationPath vs OutputPath.

Suggested change
Expand-Archive -Path $ArchiveFile -OutputPath $DestinationPath -Force -ErrorAction Stop
Expand-Archive -Path $ArchiveFile -DestinationPath $DestinationPath -Force -ErrorAction Stop

Copilot uses AI. Check for mistakes.
} -LegacyAction {
Expand-Archive -Path $ArchiveFile -DestinationPath $DestinationPath -Force -ErrorAction Stop
}
}
else {
# Use tar for tar.gz files on Unix systems
Expand Down
Loading