Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

compress-archive -update deletes an existing zip file if the -path spec returns 0 files #142

Open
3 tasks done
kaiser-roy opened this issue Oct 25, 2022 · 1 comment
Open
3 tasks done

Comments

@kaiser-roy
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

# make a tiny file
echo 'bibbity' > bibbity.txt

# this -path specification returns (at least) bibbity.txt and creates bobbity.zip
compress-archive -path bibbity.* -update -destinationpath bobbity.zip

# Now remove any such files
rm bibbity.*

# THIS path spec now returns nothing, and compress-archive actually deletes bobbity.zip!
compress-archive -path bibbity.* -update -destinationpath bobbity.zip

Expected behavior

The second call to compress-archive should leave the existing 'bobbity.zip' file undisturbed, but instead it completely removes it.

Actual behavior

'bobbity.zip' file is removed.

This is likely related to #112, though I think the use-case here is more general.

Error details

n/a

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.1682
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1682
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

5.1.19041.1682

Visuals

No response

@ayousuf23
Copy link
Contributor

Thanks for reporting the bug! Since this is related to #112, which may have been solved in the latest preview, this bug might also have been solved. I will need to double check though.

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

No branches or pull requests

2 participants