mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-10 23:58:19 +00:00
Update cheatsheets
This commit is contained in:
29
tldr/windows/compress-archive
Normal file
29
tldr/windows/compress-archive
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
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/en-us/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}}`
|
||||
Reference in New Issue
Block a user