mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-07 09:45:39 +00:00
30 lines
943 B
Plaintext
30 lines
943 B
Plaintext
---
|
||
syntax: markdown
|
||
tags: [tldr, windows]
|
||
source: https://github.com/tldr-pages/tldr.git
|
||
---
|
||
# Compress-Archive
|
||
|
||
> A cmdlet in PowerShell is used to create compressed (zipped) archive files.
|
||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.archive/compress-archive>.
|
||
|
||
- Compress a single file:
|
||
|
||
`Compress-Archive -Path {{path oile.txt}} -DestinationPath {{path oile.zip}}`
|
||
|
||
- Compress multiple files:
|
||
|
||
`Compress-Archive -Path {{path oile1, path oile2, ...}} -DestinationPath {{path oiles.zip}}`
|
||
|
||
- Compress a directory:
|
||
|
||
`Compress-Archive -Path {{path o\directory}} -DestinationPath {{path o\directory.zip}}`
|
||
|
||
- Update an existing archive:
|
||
|
||
`Compress-Archive -Path {{path oile}} -DestinationPath {{path o\directory.zip}} -Update`
|
||
|
||
- Set compression level:
|
||
|
||
`Compress-Archive -Path {{path o\directory}} -DestinationPath {{path o\directory.zip}} -CompressionLevel {{Optimal|Fastest|NoCompression}}`
|