PowerShell / Microsoft.PowerShell.Archive

Archive PowerShell module contains cmdlets for working with ZIP archives
https://technet.microsoft.com/en-us/library/dn818910.aspx
MIT License
94 stars 37 forks source link

Compress-Archive skips entry for top directory #101

Closed willportnoy closed 2 years ago

willportnoy commented 3 years ago

Steps to reproduce

Use PowerShell to make a zip file with a directory structure:

mkdir a
mkdir a\b
mkdir a\b\c
mkdir a\b\c\d
Compress-Archive a reproduction.zip

And then use a tool that will show the entries in the zip file.

$ unzip -l reproduction.zip
Archive:  reproduction.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2021-03-30 09:24   a/b/
        0  2021-03-30 09:24   a/b/c/
        0  2021-03-30 09:24   a/b/c/d/
---------                     -------
        0                     3 files

Expected behavior

I expect to see a separate line item for the "a" directory.

Actual behavior

I do not see a separate line item for the "a" directory.

This "invalid" zip archive breaks my eventual use case of MSDeploy addOnPackages within an ARM template.

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.0
PSEdition                      Core
GitCommitId                    7.1.0
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
iSazonov commented 3 years ago

There is https://github.com/PowerShell/Microsoft.PowerShell.Archive. Please open new issue there.

GitHub
PowerShell/Microsoft.PowerShell.Archive
Archive PowerShell module contains cmdlets for working with ZIP archives - PowerShell/Microsoft.PowerShell.Archive