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 should support compressing hidden files #154

Open jtmoon79 opened 10 months ago

jtmoon79 commented 10 months ago

Summary of the new feature / enhancement

Currently Compress-Archive fails to compress hidden files. So for example, Compress-Archive -Path C:\My-Git-Repo will not compress the directory .git which is a directory with NTFS attribute hidden. Users must come up with various workarounds for this problem.

Users should be able to include NTFS hidden files and directories in the archive.

Proposed technical implementation details (optional)

Add a parameter switch like -Hidden or -IncludeHidden that will cause Compress-Archive to include all hidden files and directories under the -Path within the final archive file.

jtmoon79 commented 10 months ago

Whoops, looks like this is implemented in https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/66 I don't see any autolinks from that Issue into this Powershell project so I wonder if the fix is included in any Powershell release. Maybe that Microsoft.PowerShell.Archive could be included in an upcoming Powershell release?

mklement0 commented 10 months ago

@jtmoon79, as of PowerShell 7.5.0-preview.1 / 7.4.1, the bundled version of the module is 1.2.5

It would certainly be good to know in what PowerShell version the fix will land, but it will likely first become available as a NuGet package you can install on demand (a preview version is available, but the package was later unlisted). See my comment on the linked issue.