Skip to content

Compress-Archive: Mention that -Force overwrites the existing archive #10495

@rigdern

Description

@rigdern

Type of issue

Missing information

Feedback

Currently, the documentation for -Force just says:

Forces the command to run without asking for user confirmation.

It should also mention that if the zip already exists, -Force will cause it to be overwritten.

Extra context

I learned about this capability of the -Force flag when I tried to create a zip at a location that already existed. PowerShell failed with this error:

Compress-Archive : The archive file Analyses.zip already exists. Use the -Update parameter to update the existing archive file or use the -Force parameter to overwrite the existing archive file.

Page URL

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?view=powershell-7.3

Content source URL

https://github.com/MicrosoftDocs/PowerShell-Docs/blob/main/reference/7.3/Microsoft.PowerShell.Archive/Compress-Archive.md

Author

sdwheeler

Document Id

fd06f3b0-c192-378c-2f57-aae431a81242

Metadata

Metadata

Assignees

Labels

area-archiveArea - Microsoft.PowerShell.Archive module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions