diff --git a/CHANGELOG.md b/CHANGELOG.md index 4729efa36e..82c992c8e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [Unreleased](https://github.com/ScoopInstaller/Scoop/compare/master...develop) +### Bug Fixes + +- **decompress:** Use PS's default 'Expand-Archive()' ([#5185](https://github.com/ScoopInstaller/Scoop/issues/5185)) + ### Code Refactoring - **hash:** Use `Get-FileHash()` directly ([#5177](https://github.com/ScoopInstaller/Scoop/issues/5177)) diff --git a/lib/decompress.ps1 b/lib/decompress.ps1 index b56402b1d5..c3ecbe40bf 100644 --- a/lib/decompress.ps1 +++ b/lib/decompress.ps1 @@ -240,7 +240,8 @@ function Expand-ZipArchive { $OriDestinationPath = $DestinationPath $DestinationPath = "$DestinationPath\_tmp" } - Expand-Archive -Path $Path -DestinationPath $DestinationPath -Force + # Compatible with Pscx v3 (https://github.com/Pscx/Pscx) ('Microsoft.PowerShell.Archive' is not needed for Pscx v4) + Microsoft.PowerShell.Archive\Expand-Archive -Path $Path -DestinationPath $DestinationPath -Force if ($ExtractDir) { movedir "$DestinationPath\$ExtractDir" $OriDestinationPath | Out-Null Remove-Item $DestinationPath -Recurse -Force