From d5162bc331d21a1e526f7449c250e272372a9c2e Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Tue, 28 Aug 2018 16:17:48 -0700 Subject: [PATCH 1/2] Use ZipFile and ExtractToDirectory APIs to extract zip file --- .../help/UpdatableHelpSystem.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/System.Management.Automation/help/UpdatableHelpSystem.cs b/src/System.Management.Automation/help/UpdatableHelpSystem.cs index 51b1b65473b..f190f7bc8f5 100644 --- a/src/System.Management.Automation/help/UpdatableHelpSystem.cs +++ b/src/System.Management.Automation/help/UpdatableHelpSystem.cs @@ -1252,14 +1252,9 @@ private bool ExpandArchive(string source, string destination) try { - using (FileStream archiveFileStream = new FileStream(source, IO.FileMode.Open, FileAccess.Read)) - using (ZipArchive zipArchive = new ZipArchive(archiveFileStream, ZipArchiveMode.Read, false)) + using (ZipArchive zipArchive = ZipFile.Open(source, ZipArchiveMode.Read)) { - foreach (ZipArchiveEntry entry in zipArchive.Entries) - { - string extractPath = Path.Combine(destination, entry.FullName); - entry.ExtractToFile(extractPath); - } + zipArchive.ExtractToDirectory(destination); sucessfulDecompression = true; } } From d572e2f2929b1bab0966da6cfc866fcbc66600cb Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Thu, 8 Nov 2018 17:49:59 -0800 Subject: [PATCH 2/2] Update Microsoft.PowerShell.Archive version --- src/Modules/PSGalleryModules.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Modules/PSGalleryModules.csproj b/src/Modules/PSGalleryModules.csproj index 68d4dea4646..1cdb70e200e 100644 --- a/src/Modules/PSGalleryModules.csproj +++ b/src/Modules/PSGalleryModules.csproj @@ -5,7 +5,7 @@ - +