From c7bc72e0654a5d9078b704d160c71a7f12386087 Mon Sep 17 00:00:00 2001 From: showbiz2k Date: Sun, 29 Mar 2026 08:34:16 -0400 Subject: [PATCH] Refactor ZIP extraction for PowerShell compatibility Powershell core Expand-Archive cmdlet does not define the -DestinationPath parameter causing a failure to unpack. Powershell core uses -OutputPath instead. --- eng/scripts/get-aspire-cli.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/scripts/get-aspire-cli.ps1 b/eng/scripts/get-aspire-cli.ps1 index a16f6e1f102..158171057c6 100755 --- a/eng/scripts/get-aspire-cli.ps1 +++ b/eng/scripts/get-aspire-cli.ps1 @@ -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 + } -LegacyAction { + Expand-Archive -Path $ArchiveFile -DestinationPath $DestinationPath -Force -ErrorAction Stop + } } else { # Use tar for tar.gz files on Unix systems