From dc09ccbff696240d13ef9d2a9e5a7a4224bd4cdc Mon Sep 17 00:00:00 2001 From: Sri Sethu Madhavan S <124687386+sri-sethu@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:53:23 +0530 Subject: [PATCH] Compress-Archive: add page (#18853) --- pages/windows/compress-archive.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/windows/compress-archive.md diff --git a/pages/windows/compress-archive.md b/pages/windows/compress-archive.md new file mode 100644 index 0000000000..6777af5099 --- /dev/null +++ b/pages/windows/compress-archive.md @@ -0,0 +1,24 @@ +# Compress-Archive + +> A cmdlet in PowerShell is used to create compressed (zipped) archive files. +> More information: . + +- Compress a single file: + +`Compress-Archive -Path {{path\to\file.txt}} -DestinationPath {{path\to\file.zip}}` + +- Compress multiple files: + +`Compress-Archive -Path {{path\to\file1, path\to\file2, ...}} -DestinationPath {{path\to\files.zip}}` + +- Compress a directory: + +`Compress-Archive -Path {{path\to\directory}} -DestinationPath {{path\to\directory.zip}}` + +- Update an existing archive: + +`Compress-Archive -Path {{path\to\file}} -DestinationPath {{path\to\directory.zip}} -Update` + +- Set compression level: + +`Compress-Archive -Path {{path\to\directory}} -DestinationPath {{path\to\directory.zip}} -CompressionLevel {{Optimal|Fastest|NoCompression}}`