mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-20 00:50:27 +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}}`
|
||||
21
tldr/windows/expand-archive
Normal file
21
tldr/windows/expand-archive
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Expand-Archive
|
||||
|
||||
> A cmdlet in PowerShell is used to extract files from a compressed archive.
|
||||
> More information: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/expand-archive>.
|
||||
|
||||
- Extract a ZIP file to a folder:
|
||||
|
||||
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}}`
|
||||
|
||||
- Overwrite existing files:
|
||||
|
||||
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}} -Force`
|
||||
|
||||
- Preview without extracting:
|
||||
|
||||
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}} -WhatIf`
|
||||
@@ -17,6 +17,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`Get-History -Id {{id}}`
|
||||
|
||||
- Display the last N commands:
|
||||
- Display the last `n` commands:
|
||||
|
||||
`Get-History -Count {{10}}`
|
||||
`Get-History -Count {{n}}`
|
||||
|
||||
@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Send data in JSON format, specifying the appropriate content-type header:
|
||||
|
||||
`Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}`
|
||||
`Invoke-WebRequest -Body '{{{"name":"bob"}}}' -ContentType 'application/json' {{http://example.com/users/1234}}`
|
||||
|
||||
- Pass a username and password for server authentication:
|
||||
|
||||
|
||||
@@ -10,16 +10,24 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Show the status of a service (no service name will list all services):
|
||||
|
||||
`sc.exe query {{service_name}}`
|
||||
`sc query {{service_name}}`
|
||||
|
||||
- Start a service asynchronously:
|
||||
|
||||
`sc.exe create {{service_name}} binpath= {{path o\service_binary_file}}`
|
||||
`sc start {{service_name}}`
|
||||
|
||||
- Stop a service asynchronously:
|
||||
|
||||
`sc.exe delete {{service_name}}`
|
||||
`sc stop {{service_name}}`
|
||||
|
||||
- Create a service:
|
||||
|
||||
`sc create {{service_name}} binpath= {{path o\service_binary_file}}`
|
||||
|
||||
- Delete a service:
|
||||
|
||||
`sc delete {{service_name}}`
|
||||
|
||||
- Set the type of a service:
|
||||
|
||||
`sc.exe config {{service_name}} type= {{service_type}}`
|
||||
`sc config {{service_name}} type= {{service_type}}`
|
||||
|
||||
Reference in New Issue
Block a user