Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create archive from empty directory #46

Open
GSPP opened this issue Feb 12, 2018 · 2 comments
Open

Cannot create archive from empty directory #46

GSPP opened this issue Feb 12, 2018 · 2 comments

Comments

@GSPP
Copy link

GSPP commented Feb 12, 2018

Creating an archive from an empty directory results in the error message Compress-7Zip : Invalid file names have been specified: Message: the specified directory is empty! and a zero byte (invalid) 7z file. Empty directories should not be a special case.

@Scifire
Copy link

Scifire commented Nov 16, 2020

Running in the same issue.
@thoemmi Maybe you could help here? What do we have for options?

edit:
If someone running into the same issue here´s my workaround:

Import-Module 7Zip4Powershell
$Path = "D:\somepath\somefolder"
$Zip_Name = ("somefolder" + ".7z")
Write-Host $Path
if (Test-Path $Path) {
    Compress-7Zip -ArchiveFileName D:\somepath\$Zip_Name -Path $Path -Format SevenZip
"Successfully compressed '$Path'."
}

else    {
        "Directory doesn´t exist."
}

@thoemmi
Copy link
Owner

thoemmi commented Nov 16, 2020

I stopped working on the module many years ago, because I don't need it anymore. However, I'd be happy to incorporate any bug fixes.

So you options are either

  • check, if the directory is empty before calling Compress-7Zip, or
  • fix the issue and send me a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants