mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-05 06:55:45 +00:00
Move pages under tldr, lint run.sh, update docs
This commit is contained in:
25
tldr/windows/add-appxpackage
Normal file
25
tldr/windows/add-appxpackage
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Add-AppxPackage
|
||||
|
||||
> A PowerShell utility to add a signed app package (`.appx`, `.msix`, `.appxbundle` and `.msixbundle`) to a user account.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/appx/Add-AppxPackage>.
|
||||
|
||||
- Add an app package:
|
||||
|
||||
`Add-AppxPackage -Path {{path o\package.msix}}`
|
||||
|
||||
- Add an app package with dependencies:
|
||||
|
||||
`Add-AppxPackage -Path {{path o\package.msix}} -DependencyPath {{path o\dependencies.msix}}`
|
||||
|
||||
- Install an app using the app installer file:
|
||||
|
||||
`Add-AppxPackage -AppInstallerFile {{path opp.appinstaller}}`
|
||||
|
||||
- Add an unsigned package:
|
||||
|
||||
`Add-AppxPackage -Path {{path o\package.msix}} -DependencyPath {{path o\dependencies.msix}} -AllowUnsigned`
|
||||
25
tldr/windows/assoc
Normal file
25
tldr/windows/assoc
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# assoc
|
||||
|
||||
> Display or change associations between file extensions and file types.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/assoc>.
|
||||
|
||||
- List all associations between file extensions and file types:
|
||||
|
||||
`assoc`
|
||||
|
||||
- Display the associated file type for a specific extension:
|
||||
|
||||
`assoc {{.txt}}`
|
||||
|
||||
- Set the associated file type for a specific extension:
|
||||
|
||||
`assoc .{{txt}}={{txtfile}}`
|
||||
|
||||
- View the output of `assoc` one screen at a time:
|
||||
|
||||
`assoc | {{more}}`
|
||||
33
tldr/windows/attrib
Normal file
33
tldr/windows/attrib
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# attrib
|
||||
|
||||
> Display or change attributes of files or directories.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/attrib>.
|
||||
|
||||
- Display all set attributes of files in the current directory:
|
||||
|
||||
`attrib`
|
||||
|
||||
- Display all set attributes of files in a specific directory:
|
||||
|
||||
`attrib {{path o\directory}}`
|
||||
|
||||
- Display all set attributes of files and [d]irectories in the current directory:
|
||||
|
||||
`attrib /d`
|
||||
|
||||
- Display all set attributes of files in the current directory and [s]ub-directories:
|
||||
|
||||
`attrib /s`
|
||||
|
||||
- Add the `[r]ead-only` or `[a]rchive` or `[s]ystem` or `[h]idden` or `not content [i]ndexed` attribute to files or directories:
|
||||
|
||||
`attrib +{{r|a|s|h|i}} {{path oile_or_directory1 path oile_or_directory2 ...}}`
|
||||
|
||||
- Remove a specific attribute of files or directories:
|
||||
|
||||
`attrib -{{r|a|s|h|i}} {{path oile_or_directory1 path oile_or_directory2 ...}}`
|
||||
33
tldr/windows/azcopy
Normal file
33
tldr/windows/azcopy
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# azcopy
|
||||
|
||||
> A file transfer tool for uploading to Azure Cloud Storage Accounts.
|
||||
> More information: <https://learn.microsoft.com/azure/storage/common/storage-use-azcopy-v10>.
|
||||
|
||||
- Log in to an Azure Tenant:
|
||||
|
||||
`azopy login`
|
||||
|
||||
- Upload a local file:
|
||||
|
||||
`azcopy copy '{{path o\source_file}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}/{{blob_name}}'`
|
||||
|
||||
- Upload files with `.txt` and `.jpg` extensions:
|
||||
|
||||
`azcopy copy '{{path o\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --include-pattern '{{*.txt;*.jpg}}'`
|
||||
|
||||
- Copy a container directly between two Azure storage accounts:
|
||||
|
||||
`azcopy copy 'https://{{source_storage_account_name}}.blob.core.windows.net/{{container_name}}' 'https://{{destination_storage_account_name}}.blob.core.windows.net/{{container_name}}'`
|
||||
|
||||
- Synchronize a local directory and delete files in the destination if they no longer exist in the source:
|
||||
|
||||
`azcopy sync '{{path o\source_directory}}' 'https://{{storage_account_name}}.blob.core.windows.net/{{container_name}}' --recursive --delete-destination=true`
|
||||
|
||||
- Display help:
|
||||
|
||||
`azcopy --help`
|
||||
29
tldr/windows/bcdboot
Normal file
29
tldr/windows/bcdboot
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# bcdboot
|
||||
|
||||
> Configure or repair boot files.
|
||||
> More information: <https://learn.microsoft.com/windows-hardware/manufacture/desktop/bcdboot-command-line-options-techref-di>.
|
||||
|
||||
- Initialize the system partition by using BCD files from the source Windows folder:
|
||||
|
||||
`bcdboot {{C:\Windows}}`
|
||||
|
||||
- Enable [v]erbose mode:
|
||||
|
||||
`bcdboot {{C:\Windows}} /v`
|
||||
|
||||
- Specify the volume letter of the [s]ystem partition:
|
||||
|
||||
`bcdboot {{C:\Windows}} /s {{S:}}`
|
||||
|
||||
- Specify a [l]ocale:
|
||||
|
||||
`bcdboot {{C:\Windows}} /l {{en-us}}`
|
||||
|
||||
- Specify a [f]irmware type while copying the boot files to a specified volume:
|
||||
|
||||
`bcdboot {{C:\Windows}} /s {{S:}} /f {{UEFI|BIOS|ALL}}`
|
||||
29
tldr/windows/bleachbit_console
Normal file
29
tldr/windows/bleachbit_console
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# bleachbit_console
|
||||
|
||||
> Clean junk files on the filesystem.
|
||||
> More information: <https://docs.bleachbit.org/doc/command-line-interface.html>.
|
||||
|
||||
- Perform the clean-up operation and delete files:
|
||||
|
||||
`bleachbit_console.exe --clean`
|
||||
|
||||
- Preview the files that will be deleted and other changes that will be made before actually performing the clean-up operation:
|
||||
|
||||
`bleachbit_console.exe --preview`
|
||||
|
||||
- Display system information:
|
||||
|
||||
`bleachbit_console.exe --sysinfo`
|
||||
|
||||
- Start the graphical user interface (GUI) version of Bleachbit:
|
||||
|
||||
`bleachbit_console.exe --gui`
|
||||
|
||||
- Display version:
|
||||
|
||||
`bleachbit_console.exe --version`
|
||||
38
tldr/windows/cd
Normal file
38
tldr/windows/cd
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cd
|
||||
|
||||
> Display the current working directory or move to a different directory.
|
||||
> In PowerShell, this command is an alias of `Set-Location`. This documentation is based on the Command Prompt (`cmd`) version of `cd`.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cd>.
|
||||
|
||||
- View documentation of the equivalent PowerShell command:
|
||||
|
||||
`tldr set-location`
|
||||
|
||||
- Display the path of the current directory:
|
||||
|
||||
`cd`
|
||||
|
||||
- Go to a specific directory in the same drive:
|
||||
|
||||
`cd {{path o\directory}}`
|
||||
|
||||
- Go to a specific directory in a different [d]rive:
|
||||
|
||||
`cd /d {{C}}:{{path o\directory}}`
|
||||
|
||||
- Go up to the parent of the current directory:
|
||||
|
||||
`cd ..`
|
||||
|
||||
- Go to the home directory of the current user:
|
||||
|
||||
`cd %userprofile%`
|
||||
|
||||
- Go to root of current drive:
|
||||
|
||||
`cd \`
|
||||
29
tldr/windows/certutil
Normal file
29
tldr/windows/certutil
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# certutil
|
||||
|
||||
> A tool to manage and configure certificate information.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/certutil>.
|
||||
|
||||
- Dump the configuration information or files:
|
||||
|
||||
`certutil {{filename}}`
|
||||
|
||||
- Encode a file in hexadecimal:
|
||||
|
||||
`certutil -encodehex {{path o\input_file}} {{path o\output_file}}`
|
||||
|
||||
- Encode a file to Base64:
|
||||
|
||||
`certutil -encode {{path o\input_file}} {{path o\output_file}}`
|
||||
|
||||
- Decode a Base64-encoded file:
|
||||
|
||||
`certutil -decode {{path o\input_file}} {{path o\output_file}}`
|
||||
|
||||
- Generate and display a cryptographic hash over a file:
|
||||
|
||||
`certutil -hashfile {{path o\input_file}} {{md2|md4|md5|sha1|sha256|sha384|sha512}}`
|
||||
17
tldr/windows/chdir
Normal file
17
tldr/windows/chdir
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# chdir
|
||||
|
||||
> This command is an alias of `cd` in Command Prompt, and subsequently `Set-Location` in PowerShell.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/chdir>.
|
||||
|
||||
- View documentation for the original Command Prompt command:
|
||||
|
||||
`tldr cd`
|
||||
|
||||
- View documentation for the original PowerShell command:
|
||||
|
||||
`tldr set-location`
|
||||
25
tldr/windows/chkdsk
Normal file
25
tldr/windows/chkdsk
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# chkdsk
|
||||
|
||||
> Check file system and volume metadata for errors.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/chkdsk>.
|
||||
|
||||
- Specify the drive letter (followed by a colon), mount point, or volume name to check:
|
||||
|
||||
`chkdsk {{volume}}`
|
||||
|
||||
- Fix errors on a specific volume:
|
||||
|
||||
`chkdsk {{volume}} /f`
|
||||
|
||||
- Dismount a specific volume before checking:
|
||||
|
||||
`chkdsk {{volume}} /x`
|
||||
|
||||
- Change the log file size to the specified size (only for NTFS):
|
||||
|
||||
`chkdsk /l{{size}}`
|
||||
26
tldr/windows/choco
Normal file
26
tldr/windows/choco
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco
|
||||
|
||||
> The Chocolatey package manager.
|
||||
> Some subcommands such as `choco install` have their own usage documentation.
|
||||
> More information: <https://chocolatey.org>.
|
||||
|
||||
- Execute a Chocolatey command:
|
||||
|
||||
`choco {{command}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`choco -?`
|
||||
|
||||
- Display help for a specific command:
|
||||
|
||||
`choco {{command}} -?`
|
||||
|
||||
- Display version:
|
||||
|
||||
`choco --version`
|
||||
25
tldr/windows/choco-apikey
Normal file
25
tldr/windows/choco-apikey
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco apikey
|
||||
|
||||
> Manage API keys for Chocolatey sources.
|
||||
> More information: <https://chocolatey.org/docs/commands-apikey>.
|
||||
|
||||
- Display a list of sources and their API keys:
|
||||
|
||||
`choco apikey`
|
||||
|
||||
- Display a specific source and its API key:
|
||||
|
||||
`choco apikey --source "{{source_url}}"`
|
||||
|
||||
- Set an API key for a source:
|
||||
|
||||
`choco apikey --source "{{source_url}}" --key "{{api_key}}"`
|
||||
|
||||
- Remove an API key for a source:
|
||||
|
||||
`choco apikey --source "{{source_url}}" --remove`
|
||||
21
tldr/windows/choco-feature
Normal file
21
tldr/windows/choco-feature
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco feature
|
||||
|
||||
> Interact with features with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-feature>.
|
||||
|
||||
- Display a list of available features:
|
||||
|
||||
`choco feature list`
|
||||
|
||||
- Enable a feature:
|
||||
|
||||
`choco feature enable --name {{name}}`
|
||||
|
||||
- Disable a feature:
|
||||
|
||||
`choco feature disable --name {{name}}`
|
||||
25
tldr/windows/choco-info
Normal file
25
tldr/windows/choco-info
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco info
|
||||
|
||||
> Display detailed information about a package with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-info>.
|
||||
|
||||
- Display information on a specific package:
|
||||
|
||||
`choco info {{package}}`
|
||||
|
||||
- Display information for a local package only:
|
||||
|
||||
`choco info {{package}} --local-only`
|
||||
|
||||
- Specify a custom source to receive packages information from:
|
||||
|
||||
`choco info {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco info {{package}} --user {{username}} --password {{password}}`
|
||||
41
tldr/windows/choco-install
Normal file
41
tldr/windows/choco-install
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco install
|
||||
|
||||
> Install one or more packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-install>.
|
||||
|
||||
- Install one or more packages:
|
||||
|
||||
`choco install {{package1 package2 ...}}`
|
||||
|
||||
- Install packages from a custom configuration file:
|
||||
|
||||
`choco install {{path o\packages_file.config}}`
|
||||
|
||||
- Install a specific `nuspec` or `nupkg` file:
|
||||
|
||||
`choco install {{path oile}}`
|
||||
|
||||
- Install a specific version of a package:
|
||||
|
||||
`choco install {{package}} --version {{version}}`
|
||||
|
||||
- Allow installing multiple versions of a package:
|
||||
|
||||
`choco install {{package}} --allow-multiple`
|
||||
|
||||
- Confirm all prompts automatically:
|
||||
|
||||
`choco install {{package}} --yes`
|
||||
|
||||
- Specify a custom source to receive packages from:
|
||||
|
||||
`choco install {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco install {{package}} --user {{username}} --password {{password}}`
|
||||
33
tldr/windows/choco-list
Normal file
33
tldr/windows/choco-list
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco list
|
||||
|
||||
> Display a list of packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-list>.
|
||||
|
||||
- Display all available packages:
|
||||
|
||||
`choco list`
|
||||
|
||||
- Display all locally installed packages:
|
||||
|
||||
`choco list --local-only`
|
||||
|
||||
- Display a list including local programs:
|
||||
|
||||
`choco list --include-programs`
|
||||
|
||||
- Display only approved packages:
|
||||
|
||||
`choco list --approved-only`
|
||||
|
||||
- Specify a custom source to display packages from:
|
||||
|
||||
`choco list --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco list --user {{username}} --password {{password}}`
|
||||
29
tldr/windows/choco-new
Normal file
29
tldr/windows/choco-new
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco new
|
||||
|
||||
> Generate new package specification files with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-new>.
|
||||
|
||||
- Create a new package skeleton:
|
||||
|
||||
`choco new {{package}}`
|
||||
|
||||
- Create a new package with a specific version:
|
||||
|
||||
`choco new {{package}} --version {{version}}`
|
||||
|
||||
- Create a new package with a specific maintainer name:
|
||||
|
||||
`choco new {{package}} --maintainer {{maintainer_name}}`
|
||||
|
||||
- Create a new package in a custom output directory:
|
||||
|
||||
`choco new {{package}} --output-directory {{path/to/directory}}`
|
||||
|
||||
- Create a new package with specific 32-bit and 64-bit installer URLs:
|
||||
|
||||
`choco new {{package}} url="{{url}}" url64="{{url}}"`
|
||||
25
tldr/windows/choco-outdated
Normal file
25
tldr/windows/choco-outdated
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco outdated
|
||||
|
||||
> Check for outdated packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-outdated>.
|
||||
|
||||
- Display a list of outdated packages in table format:
|
||||
|
||||
`choco outdated`
|
||||
|
||||
- Ignore pinned packages in the output:
|
||||
|
||||
`choco outdated --ignore-pinned`
|
||||
|
||||
- Specify a custom source to check packages from:
|
||||
|
||||
`choco outdated --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco outdated --user {{username}} --password {{password}}`
|
||||
21
tldr/windows/choco-pack
Normal file
21
tldr/windows/choco-pack
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco pack
|
||||
|
||||
> Package a NuGet specification into a `nupkg` file.
|
||||
> More information: <https://chocolatey.org/docs/commands-pack>.
|
||||
|
||||
- Package a NuGet specification to a `nupkg` file:
|
||||
|
||||
`choco pack {{path o\specification_file}}`
|
||||
|
||||
- Package a NuGet specification specifying the version of the resulting file:
|
||||
|
||||
`choco pack {{path o\specification_file}} --version {{version}}`
|
||||
|
||||
- Package a NuGet specification to a specific directory:
|
||||
|
||||
`choco pack {{path o\specification_file}} --output-directory {{path o\output_directory}}`
|
||||
26
tldr/windows/choco-pin
Normal file
26
tldr/windows/choco-pin
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco pin
|
||||
|
||||
> Pin a package at a version with Chocolatey.
|
||||
> Pinned packages are skipped automatically when upgrading.
|
||||
> More information: <https://chocolatey.org/docs/commands-pin>.
|
||||
|
||||
- Display a list of pinned packages and their versions:
|
||||
|
||||
`choco pin list`
|
||||
|
||||
- Pin a package at its current version:
|
||||
|
||||
`choco pin add --name {{package}}`
|
||||
|
||||
- Pin a package at a specific version:
|
||||
|
||||
`choco pin add --name {{package}} --version {{version}}`
|
||||
|
||||
- Remove a pin for a specific package:
|
||||
|
||||
`choco pin remove --name {{package}}`
|
||||
17
tldr/windows/choco-push
Normal file
17
tldr/windows/choco-push
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco-push
|
||||
|
||||
> Push a compiled NuGet package (`nupkg`) to a package feed.
|
||||
> More information: <https://docs.chocolatey.org/en-us/create/commands/push>.
|
||||
|
||||
- Push a compiled `nupkg` to the specified feed:
|
||||
|
||||
`choco push --source {{https://push.chocolatey.org/}}`
|
||||
|
||||
- Push a compiled `nupkg` to the specified feed with a timeout in seconds (default is 2700):
|
||||
|
||||
`choco push --source {{https://push.chocolatey.org/}} --execution-timeout {{500}}`
|
||||
33
tldr/windows/choco-search
Normal file
33
tldr/windows/choco-search
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco search
|
||||
|
||||
> Search for a local or remote package with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-search>.
|
||||
|
||||
- Search for a package:
|
||||
|
||||
`choco search {{query}}`
|
||||
|
||||
- Search for a package locally:
|
||||
|
||||
`choco search {{query}} --local-only`
|
||||
|
||||
- Only include exact matches in the results:
|
||||
|
||||
`choco search {{query}} --exact`
|
||||
|
||||
- Confirm all prompts automatically:
|
||||
|
||||
`choco search {{query}} --yes`
|
||||
|
||||
- Specify a custom source to search for packages in:
|
||||
|
||||
`choco search {{query}} --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco search {{query}} --user {{username}} --password {{password}}`
|
||||
25
tldr/windows/choco-source
Normal file
25
tldr/windows/choco-source
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco source
|
||||
|
||||
> Manage sources for packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-source>.
|
||||
|
||||
- List currently available sources:
|
||||
|
||||
`choco source list`
|
||||
|
||||
- Add a new package source:
|
||||
|
||||
`choco source add --name {{name}} --source {{url}}`
|
||||
|
||||
- Add a new package source with credentials:
|
||||
|
||||
`choco source add --name {{name}} --source {{url}} --user {{username}} --password {{password}}`
|
||||
|
||||
- Add a new package source with a client certificate:
|
||||
|
||||
`choco source add --name {{name}} --source {{url}} --cert {{path o
|
||||
29
tldr/windows/choco-uninstall
Normal file
29
tldr/windows/choco-uninstall
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco uninstall
|
||||
|
||||
> Uninstall packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-uninstall>.
|
||||
|
||||
- Uninstall one or more packages:
|
||||
|
||||
`choco uninstall {{package1 package2 ...}}`
|
||||
|
||||
- Uninstall a specific version of a package:
|
||||
|
||||
`choco uninstall {{package}} --version {{version}}`
|
||||
|
||||
- Confirm all prompts automatically:
|
||||
|
||||
`choco uninstall {{package}} --yes`
|
||||
|
||||
- Remove all dependencies when uninstalling:
|
||||
|
||||
`choco uninstall {{package}} --remove-dependencies`
|
||||
|
||||
- Uninstall all packages:
|
||||
|
||||
`choco uninstall all`
|
||||
37
tldr/windows/choco-upgrade
Normal file
37
tldr/windows/choco-upgrade
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choco upgrade
|
||||
|
||||
> Upgrade one or more packages with Chocolatey.
|
||||
> More information: <https://chocolatey.org/docs/commands-upgrade>.
|
||||
|
||||
- Upgrade one or more packages:
|
||||
|
||||
`choco upgrade {{package1 package2 ...}}`
|
||||
|
||||
- Upgrade to a specific version of a package:
|
||||
|
||||
`choco upgrade {{package}} --version {{version}}`
|
||||
|
||||
- Upgrade all packages:
|
||||
|
||||
`choco upgrade all`
|
||||
|
||||
- Upgrade all except specified comma-separated packages:
|
||||
|
||||
`choco upgrade all --except "{{package1,package2,...}}"`
|
||||
|
||||
- Confirm all prompts automatically:
|
||||
|
||||
`choco upgrade {{package}} --yes`
|
||||
|
||||
- Specify a custom source to receive packages from:
|
||||
|
||||
`choco upgrade {{package}} --source {{source_url|alias}}`
|
||||
|
||||
- Provide a username and password for authentication:
|
||||
|
||||
`choco upgrade {{package}} --user {{username}} --password {{password}}`
|
||||
33
tldr/windows/choice
Normal file
33
tldr/windows/choice
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# choice
|
||||
|
||||
> Prompt user to select a choice and return the selected choice index.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/choice>.
|
||||
|
||||
- Prompt the current user to select a `Y` or `N` choice:
|
||||
|
||||
`choice`
|
||||
|
||||
- Prompt the current user to select a [c]hoice from a specific set:
|
||||
|
||||
`choice /c {{AB}}`
|
||||
|
||||
- Prompt the current user to select a choice with a specific [m]essage:
|
||||
|
||||
`choice /m "{{message}}"`
|
||||
|
||||
- Prompt the current user to select a [c]ase-[s]ensitive [c]hoice from a specific set:
|
||||
|
||||
`choice /cs /c {{Ab}}`
|
||||
|
||||
- Prompt the current user to select a choice and prefer the [d]efault choice in a specific [t]ime:
|
||||
|
||||
`choice /t {{5}} /d {{N}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`choice /?`
|
||||
13
tldr/windows/chrome
Normal file
13
tldr/windows/chrome
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# chrome
|
||||
|
||||
> This command is an alias of `chromium`.
|
||||
> More information: <https://chrome.google.com>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr chromium`
|
||||
13
tldr/windows/cinst
Normal file
13
tldr/windows/cinst
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cinst
|
||||
|
||||
> This command is an alias of `choco install`.
|
||||
> More information: <https://docs.chocolatey.org/en-us/choco/commands/install>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr choco install`
|
||||
25
tldr/windows/cipher
Normal file
25
tldr/windows/cipher
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cipher
|
||||
|
||||
> Display or alter the encryption of directories and files on NTFS volumes.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cipher>.
|
||||
|
||||
- Display information about a specific encrypted file or directory:
|
||||
|
||||
`cipher /c:{{path oile_or_directory}}`
|
||||
|
||||
- [e]ncrypt a file or directory (files added later to the directory are also encrypted as the directory is marked):
|
||||
|
||||
`cipher /e:{{path oile_or_directory}}`
|
||||
|
||||
- [d]ecrypt a file or directory:
|
||||
|
||||
`cipher /d:{{path oile_or_directory}}`
|
||||
|
||||
- Securely remove a file or directory:
|
||||
|
||||
`cipher /w:{{path oile_or_directory}}`
|
||||
12
tldr/windows/clear
Normal file
12
tldr/windows/clear
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# clear
|
||||
|
||||
> In PowerShell, this command is an alias of `Clear-Host`.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr clear-host`
|
||||
14
tldr/windows/clear-host
Normal file
14
tldr/windows/clear-host
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Clear-Host
|
||||
|
||||
> Clears the screen.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/clear-host>.
|
||||
|
||||
- Clear the screen:
|
||||
|
||||
`cls`
|
||||
22
tldr/windows/clear-recyclebin
Normal file
22
tldr/windows/clear-recyclebin
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Clear-RecycleBin
|
||||
|
||||
> Clear items from the Recycle Bin.
|
||||
> This command can only be used through PowerShell versions 5.1 and below, or 7.1 and above.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/clear-recyclebin>.
|
||||
|
||||
- Clear and delete all items inside the Recycle Bin:
|
||||
|
||||
`Clear-RecycleBin`
|
||||
|
||||
- Clear the Recycle Bin for a specific drive:
|
||||
|
||||
`Clear-RecycleBin -DriveLetter {{C}}`
|
||||
|
||||
- Clear the Recycle Bin without further confirmation:
|
||||
|
||||
`Clear-RecycleBin -Force`
|
||||
25
tldr/windows/clip
Normal file
25
tldr/windows/clip
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# clip
|
||||
|
||||
> Copy input content to the Windows clipboard.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/clip>.
|
||||
|
||||
- Pipe command-line output to the Windows clipboard:
|
||||
|
||||
`{{dir}} | clip`
|
||||
|
||||
- Copy the contents of a file to the Windows clipboard:
|
||||
|
||||
`clip < {{path oile.ext}}`
|
||||
|
||||
- Copy text with a trailing newline to the Windows clipboard:
|
||||
|
||||
`echo {{some text}} | clip`
|
||||
|
||||
- Copy text without a trailing newline to the Windows clipboard:
|
||||
|
||||
`echo | set /p="some text" | clip`
|
||||
13
tldr/windows/clist
Normal file
13
tldr/windows/clist
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# clist
|
||||
|
||||
> This command is an alias of `choco list`.
|
||||
> More information: <https://docs.chocolatey.org/en-us/choco/commands/list>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr choco list`
|
||||
18
tldr/windows/cls
Normal file
18
tldr/windows/cls
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cls
|
||||
|
||||
> Clears the screen.
|
||||
> In PowerShell, this command is an alias of `Clear-Host`. This documentation is based on the Command Prompt (`cmd`) version of `cls`.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cls>.
|
||||
|
||||
- View the documentation of the equivalent PowerShell command:
|
||||
|
||||
`tldr clear-host`
|
||||
|
||||
- Clear the screen:
|
||||
|
||||
`cls`
|
||||
41
tldr/windows/cmd
Normal file
41
tldr/windows/cmd
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cmd
|
||||
|
||||
> The Windows command interpreter.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cmd>.
|
||||
|
||||
- Start an interactive shell session:
|
||||
|
||||
`cmd`
|
||||
|
||||
- Execute specific [c]ommands:
|
||||
|
||||
`cmd /c {{echo Hello world}}`
|
||||
|
||||
- Execute a specific script:
|
||||
|
||||
`cmd {{path o\script.bat}}`
|
||||
|
||||
- Execute specific commands and then enter an interactive shell:
|
||||
|
||||
`cmd /k {{echo Hello world}}`
|
||||
|
||||
- Start an interactive shell session where `echo` is disabled in command output:
|
||||
|
||||
`cmd /q`
|
||||
|
||||
- Start an interactive shell session with delayed [v]ariable expansion enabled or disabled:
|
||||
|
||||
`cmd /v:{{on|off}}`
|
||||
|
||||
- Start an interactive shell session with command [e]xtensions enabled or disabled:
|
||||
|
||||
`cmd /e:{{on|off}}`
|
||||
|
||||
- Start an interactive shell session with used [u]nicode encoding:
|
||||
|
||||
`cmd /u`
|
||||
21
tldr/windows/cmdkey
Normal file
21
tldr/windows/cmdkey
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cmdkey
|
||||
|
||||
> Create, show, and delete stored user names and passwords.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cmdkey>.
|
||||
|
||||
- List all user credentials:
|
||||
|
||||
`cmdkey /list`
|
||||
|
||||
- Store credentials for a user that accesses a server:
|
||||
|
||||
`cmdkey /add:{{server_name}} /user:{{user_name}}`
|
||||
|
||||
- Delete credentials for a specific target:
|
||||
|
||||
`cmdkey /delete {{target_name}}`
|
||||
41
tldr/windows/cmstp
Normal file
41
tldr/windows/cmstp
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cmstp
|
||||
|
||||
> Manage connection service profiles.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/cmstp>.
|
||||
|
||||
- Install a specific profile:
|
||||
|
||||
`cmstp "{{path o\profile_file}}"`
|
||||
|
||||
- Install without creating a desktop shortcut:
|
||||
|
||||
`cmstp /ns "{{path o\profile_file}}"`
|
||||
|
||||
- Install without checking for dependencies:
|
||||
|
||||
`cmstp /nf "{{path o\profile_file}}"`
|
||||
|
||||
- Only install for the current user:
|
||||
|
||||
`cmstp /su "{{path o\profile_file}}"`
|
||||
|
||||
- Install for all users (requires administrator privileges):
|
||||
|
||||
`cmstp /au "{{path o\profile_file}}"`
|
||||
|
||||
- Install silently without any prompts:
|
||||
|
||||
`cmstp /s "{{path o\profile_file}}"`
|
||||
|
||||
- Uninstall a specific profile:
|
||||
|
||||
`cmstp /u "{{path o\profile_file}}"`
|
||||
|
||||
- Uninstall silently without a confirmation prompt:
|
||||
|
||||
`cmstp /u /s "{{path o\profile_file}}"`
|
||||
21
tldr/windows/color
Normal file
21
tldr/windows/color
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# color
|
||||
|
||||
> Set the console foreground and background colors.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/color>.
|
||||
|
||||
- Set the console colors to the default values:
|
||||
|
||||
`color`
|
||||
|
||||
- List available color values and detailed information:
|
||||
|
||||
`color /?`
|
||||
|
||||
- Set the console foreground and background to a specific color using hexadecimal numbers (`1-9,a-f`):
|
||||
|
||||
`color {{foreground_code}}{{background_code}}`
|
||||
42
tldr/windows/comp
Normal file
42
tldr/windows/comp
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# comp
|
||||
|
||||
> Compare the contents of two files or sets of files.
|
||||
> Use wildcards (*) to compare sets of files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/comp>.
|
||||
|
||||
- Compare files interactively:
|
||||
|
||||
`comp`
|
||||
|
||||
- Compare two specified files:
|
||||
|
||||
`comp {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare two sets of files:
|
||||
|
||||
`comp {{path o\directory1}}\* {{path o\directory2}}\*`
|
||||
|
||||
- Display differences in decimal format:
|
||||
|
||||
`comp /d {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Display differences in ASCII format:
|
||||
|
||||
`comp /a {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Display line numbers for differences:
|
||||
|
||||
`comp /l {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare files case-insensitively:
|
||||
|
||||
`comp /c {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare only the first 5 lines of each file:
|
||||
|
||||
`comp /n={{5}} {{path oile1}} {{path oile2}}`
|
||||
13
tldr/windows/cpush
Normal file
13
tldr/windows/cpush
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cpush
|
||||
|
||||
> This command is an alias of `choco push`.
|
||||
> More information: <https://docs.chocolatey.org/en-us/create/commands/push>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr choco-push`
|
||||
13
tldr/windows/cuninst
Normal file
13
tldr/windows/cuninst
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# cuninst
|
||||
|
||||
> This command is an alias of `choco uninstall`.
|
||||
> More information: <https://docs.chocolatey.org/en-us/choco/commands/uninstall>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr choco uninstall`
|
||||
21
tldr/windows/curl
Normal file
21
tldr/windows/curl
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# curl
|
||||
|
||||
> In PowerShell, this command may be an alias of `Invoke-WebRequest` when the original `curl` program (<https://curl.se>) is not properly installed.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>.
|
||||
|
||||
- View documentation for the original `curl` command:
|
||||
|
||||
`tldr curl -p common`
|
||||
|
||||
- View documentation for PowerShell's `Invoke-WebRequest` command:
|
||||
|
||||
`tldr invoke-webrequest`
|
||||
|
||||
- Check whether `curl` is properly installed by printing its version number. If this command evaluates into an error, PowerShell may have substituted this command with `Invoke-WebRequest`:
|
||||
|
||||
`curl --version`
|
||||
21
tldr/windows/date
Normal file
21
tldr/windows/date
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# date
|
||||
|
||||
> Displays or sets the system date.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/date>.
|
||||
|
||||
- Display the current system date and prompt to enter a new date (leave empty to keep unchanged):
|
||||
|
||||
`date`
|
||||
|
||||
- Display the current system date without prompting for a new date:
|
||||
|
||||
`date /t`
|
||||
|
||||
- Change the current system date to a specific date:
|
||||
|
||||
`date {{month}}-{{day}}-{{year}}`
|
||||
42
tldr/windows/del
Normal file
42
tldr/windows/del
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# del
|
||||
|
||||
> Delete one or more files.
|
||||
> In PowerShell, this command is an alias of `Remove-Item`. This documentation is based on the Command Prompt (`cmd`) version of `del`.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/del>.
|
||||
|
||||
- View the documentation of the equivalent PowerShell command:
|
||||
|
||||
`tldr remove-item`
|
||||
|
||||
- Delete one or more files or patterns:
|
||||
|
||||
`del {{file_pattern1 file_pattern2 ...}}`
|
||||
|
||||
- Prompt for confirmation before deleting each file:
|
||||
|
||||
`del {{file_pattern}} /p`
|
||||
|
||||
- Force the deletion of read-only files:
|
||||
|
||||
`del {{file_pattern}} /f`
|
||||
|
||||
- Recursively delete file(s) from all subdirectories:
|
||||
|
||||
`del {{file_pattern}} /s`
|
||||
|
||||
- Do not prompt when deleting files based on a global wildcard:
|
||||
|
||||
`del {{file_pattern}} /q`
|
||||
|
||||
- Display the help and list available attributes:
|
||||
|
||||
`del /?`
|
||||
|
||||
- Delete files based on specified attributes:
|
||||
|
||||
`del {{file_pattern}} /a {{attribute}}`
|
||||
29
tldr/windows/dir
Normal file
29
tldr/windows/dir
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# dir
|
||||
|
||||
> List directory contents.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/dir>.
|
||||
|
||||
- Show the contents of the current directory:
|
||||
|
||||
`dir`
|
||||
|
||||
- Show the contents of a given directory:
|
||||
|
||||
`dir {{path o\directory}}`
|
||||
|
||||
- Show the contents of the current directory, including hidden ones:
|
||||
|
||||
`dir /a`
|
||||
|
||||
- Show the contents of a given directory, including hidden ones:
|
||||
|
||||
`dir {{path o\directory}} /a`
|
||||
|
||||
- Show a bare list of directories and files, with no additional information:
|
||||
|
||||
`dir /b`
|
||||
37
tldr/windows/diskpart
Normal file
37
tldr/windows/diskpart
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# diskpart
|
||||
|
||||
> Disk, volume and partition manager.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/diskpart>.
|
||||
|
||||
- Run diskpart by itself in an administrative command prompt to enter its command-line:
|
||||
|
||||
`diskpart`
|
||||
|
||||
- List all disks:
|
||||
|
||||
`list disk`
|
||||
|
||||
- Select a volume:
|
||||
|
||||
`select volume {{volume}}`
|
||||
|
||||
- Assign a drive letter to the selected volume:
|
||||
|
||||
`assign letter {{letter}}`
|
||||
|
||||
- Create a new partition:
|
||||
|
||||
`create partition primary`
|
||||
|
||||
- Activate the selected volume:
|
||||
|
||||
`active`
|
||||
|
||||
- Exit diskpart:
|
||||
|
||||
`exit`
|
||||
37
tldr/windows/doskey
Normal file
37
tldr/windows/doskey
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# doskey
|
||||
|
||||
> Manage macros, windows commands and command-lines.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/doskey>.
|
||||
|
||||
- List available macros:
|
||||
|
||||
`doskey /macros`
|
||||
|
||||
- Create a new macro:
|
||||
|
||||
`doskey {{name}} = "{{command}}"`
|
||||
|
||||
- Create a new macro for a specific executable:
|
||||
|
||||
`doskey /exename={{executable}} {{name}} = "{{command}}"`
|
||||
|
||||
- Remove a macro:
|
||||
|
||||
`doskey {{name}} =`
|
||||
|
||||
- Display all commands that are stored in memory:
|
||||
|
||||
`doskey /history`
|
||||
|
||||
- Save macros to a file for portability:
|
||||
|
||||
`doskey /macros > {{path o\macinit_file}}`
|
||||
|
||||
- Load macros from a file:
|
||||
|
||||
`doskey /macrofile = {{path o\macinit_file}}`
|
||||
37
tldr/windows/driverquery
Normal file
37
tldr/windows/driverquery
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# driverquery
|
||||
|
||||
> Display information about installed device drivers.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/driverquery>.
|
||||
|
||||
- Display a list of all installed device drivers:
|
||||
|
||||
`driverquery`
|
||||
|
||||
- Display a list of drivers in the specified format:
|
||||
|
||||
`driverquery /fo {{table|list|csv}}`
|
||||
|
||||
- Display a list of drivers with a column to indicate if they are signed:
|
||||
|
||||
`driverquery /si`
|
||||
|
||||
- Exclude the header in the output list:
|
||||
|
||||
`driverquery /nh`
|
||||
|
||||
- Display a list of drivers for a remote machine:
|
||||
|
||||
`driverquery /s {{hostname}} /u {{username}} /p {{password}}`
|
||||
|
||||
- Display a list of drivers with verbose information:
|
||||
|
||||
`driverquery /v`
|
||||
|
||||
- Display help:
|
||||
|
||||
`driverquery /?`
|
||||
26
tldr/windows/eventcreate
Normal file
26
tldr/windows/eventcreate
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# eventcreate
|
||||
|
||||
> Create custom entries in the event log.
|
||||
> Event IDs can be any number between 1 and 1000.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/eventcreate>.
|
||||
|
||||
- Create a new event with a given ID (1-1000) in the log:
|
||||
|
||||
`eventcreate /t {{success|error|warning|information}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- Create an event in a specific event log:
|
||||
|
||||
`eventcreate /l {{log_name}} /t {{type}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- Create an event with a specific source:
|
||||
|
||||
`eventcreate /so {{source_name}} /t {{type}} /id {{id}} /d "{{message}}"`
|
||||
|
||||
- Create an event in a remote machine's event log:
|
||||
|
||||
`eventcreate /s {{hostname}} /u {{username}} /p {{password}} /t {{type}} /id {{id}} /d "{{message}}"`
|
||||
21
tldr/windows/exit
Normal file
21
tldr/windows/exit
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# exit
|
||||
|
||||
> Quit the current CMD instance or the current batch file.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/exit>.
|
||||
|
||||
- Quit the current CMD instance:
|
||||
|
||||
`exit`
|
||||
|
||||
- Quit the current batch script:
|
||||
|
||||
`exit /b`
|
||||
|
||||
- Quit using a specific exit code:
|
||||
|
||||
`exit {{2}}`
|
||||
29
tldr/windows/expand
Normal file
29
tldr/windows/expand
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# expand
|
||||
|
||||
> Uncompress Windows Cabinet files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/expand>.
|
||||
|
||||
- Uncompress a single-file Cabinet file to the specified directory:
|
||||
|
||||
`expand {{path oile.cab}} {{path o\directory}}`
|
||||
|
||||
- Display the list of files in a source Cabinet file:
|
||||
|
||||
`expand {{path oile.cab}} {{path o\directory}} -d`
|
||||
|
||||
- Uncompress all files from the Cabinet file:
|
||||
|
||||
`expand {{path oile.cab}} {{path o\directory}} -f:*`
|
||||
|
||||
- Uncompress a specific file from a Cabinet file:
|
||||
|
||||
`expand {{path oile.cab}} {{path o\directory}} -f:{{path oile}}`
|
||||
|
||||
- Ignore the directory structure when uncompressing, and add them to a single directory:
|
||||
|
||||
`expand {{path oile.cab}} {{path o\directory}} -i`
|
||||
21
tldr/windows/explorer
Normal file
21
tldr/windows/explorer
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# explorer
|
||||
|
||||
> The Windows File Explorer.
|
||||
> More information: <https://ss64.com/nt/explorer.html>.
|
||||
|
||||
- Open Windows Explorer:
|
||||
|
||||
`explorer`
|
||||
|
||||
- Open Windows Explorer in the current directory:
|
||||
|
||||
`explorer .`
|
||||
|
||||
- Open Windows Explorer in a specific directory:
|
||||
|
||||
`explorer {{path o\directory}}`
|
||||
38
tldr/windows/fc
Normal file
38
tldr/windows/fc
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# fc
|
||||
|
||||
> Compare the differences between two files or sets of files.
|
||||
> Use wildcards (*) to compare sets of files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/fc>.
|
||||
|
||||
- Compare 2 specified files:
|
||||
|
||||
`fc {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Perform a case-insensitive comparison:
|
||||
|
||||
`fc /c {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare files as Unicode text:
|
||||
|
||||
`fc /u {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare files as ASCII text:
|
||||
|
||||
`fc /l {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compare files as binary:
|
||||
|
||||
`fc /b {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Disable tab-to-space expansion:
|
||||
|
||||
`fc /t {{path oile1}} {{path oile2}}`
|
||||
|
||||
- Compress whitespace (tabs and spaces) for comparisons:
|
||||
|
||||
`fc /w {{path oile1}} {{path oile2}}`
|
||||
25
tldr/windows/find
Normal file
25
tldr/windows/find
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# find
|
||||
|
||||
> Find a specified string in files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/find>.
|
||||
|
||||
- Find lines that contain a specified string:
|
||||
|
||||
`find "{{string}}" {{path oile_or_directory}}`
|
||||
|
||||
- Display lines that do not contain the specified string:
|
||||
|
||||
`find "{{string}}" {{path oile_or_directory}} /v`
|
||||
|
||||
- Display the count of lines that contain the specified string:
|
||||
|
||||
`find "{{string}}" {{path oile_or_directory}} /c`
|
||||
|
||||
- Display line numbers with the list of lines:
|
||||
|
||||
`find "{{string}}" {{path oile_or_directory}} /n`
|
||||
41
tldr/windows/findstr
Normal file
41
tldr/windows/findstr
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# findstr
|
||||
|
||||
> Find specified text within one or more files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/findstr>.
|
||||
|
||||
- Find one or more strings in all files:
|
||||
|
||||
`findstr "{{string1 string2 ...}}" *`
|
||||
|
||||
- Find one or more strings in a piped command's output:
|
||||
|
||||
`{{dir}} | findstr "{{string1 string2 ...}}"`
|
||||
|
||||
- Find one or more strings in all files recur[s]ively:
|
||||
|
||||
`findstr /s "{{string1 string2 ...}}" *`
|
||||
|
||||
- Find strings using a case-insensitive search:
|
||||
|
||||
`findstr /i "{{string1 string2 ...}}" *"`
|
||||
|
||||
- Find strings in all files using regular expressions:
|
||||
|
||||
`findstr /r "{{expression}}" *`
|
||||
|
||||
- Find a literal string (containing spaces) in all text files:
|
||||
|
||||
`findstr /c:"{{string1 string2 ...}}" *.txt`
|
||||
|
||||
- Display the line number before each matching line:
|
||||
|
||||
`findstr /n "{{string1 string2 ...}}" *`
|
||||
|
||||
- Display only the filenames that contain a match:
|
||||
|
||||
`findstr /m "{{string1 string2 ...}}" *`
|
||||
26
tldr/windows/finger
Normal file
26
tldr/windows/finger
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# finger
|
||||
|
||||
> Return information about users on a specified system.
|
||||
> The remote system must be running the Finger service.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/finger>.
|
||||
|
||||
- Display information about a specific user:
|
||||
|
||||
`finger {{user}}@{{host}}`
|
||||
|
||||
- Display information about all users on the specified host:
|
||||
|
||||
`finger @{{host}}`
|
||||
|
||||
- Display information in a longer format:
|
||||
|
||||
`finger {{user}}@{{host}} -l`
|
||||
|
||||
- Display help information:
|
||||
|
||||
`finger /?`
|
||||
21
tldr/windows/fondue
Normal file
21
tldr/windows/fondue
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# fondue
|
||||
|
||||
> Install optional Windows features.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/fondue>.
|
||||
|
||||
- Enable a specific Windows feature:
|
||||
|
||||
`fondue /enable-feature:{{feature}}`
|
||||
|
||||
- Hide all output messages to the user:
|
||||
|
||||
`fondue /enable-feature:{{feature}} /hide-ux:all`
|
||||
|
||||
- Specify a caller process name for error reporting:
|
||||
|
||||
`fondue /enable-feature:{{feature}} /caller-name:{{name}}`
|
||||
29
tldr/windows/for
Normal file
29
tldr/windows/for
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# for
|
||||
|
||||
> Conditionally execute a command several times.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/for>.
|
||||
|
||||
- Execute given commands for the specified set:
|
||||
|
||||
`for %{{variable}} in ({{item_a item_b item_c}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given range of numbers:
|
||||
|
||||
`for /l %{{variable}} in ({{from}}, {{step}}, {{to}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given list of files:
|
||||
|
||||
`for %{{variable}} in ({{path oile1.ext path oile2.ext ...}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Iterate over a given list of directories:
|
||||
|
||||
`for /d %{{variable}} in ({{path o\directory1.ext path o\directory2.ext ...}}) do ({{echo Loop is executed}})`
|
||||
|
||||
- Perform a given command in every directory:
|
||||
|
||||
`for /d %{{variable}} in (*) do (if exist %{{variable}} {{echo Loop is executed}})`
|
||||
33
tldr/windows/forfiles
Normal file
33
tldr/windows/forfiles
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# forfiles
|
||||
|
||||
> Select files to execute a specified command on.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/forfiles>.
|
||||
|
||||
- Search for files in the current directory:
|
||||
|
||||
`forfiles`
|
||||
|
||||
- Search for files in a specific directory:
|
||||
|
||||
`forfiles /p {{path o\directory}}`
|
||||
|
||||
- Run the specified command for each file:
|
||||
|
||||
`forfiles /c "{{command}}"`
|
||||
|
||||
- Search for files using a specific glob mask:
|
||||
|
||||
`forfiles /m {{glob_pattern}}`
|
||||
|
||||
- Search for files recursively:
|
||||
|
||||
`forfiles /s`
|
||||
|
||||
- Search for files older than 5 days:
|
||||
|
||||
`forfiles /d +{{5}}`
|
||||
29
tldr/windows/fsutil
Normal file
29
tldr/windows/fsutil
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# fsutil
|
||||
|
||||
> Displays information about file system volumes.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/fsutil>.
|
||||
|
||||
- Display a list of volumes:
|
||||
|
||||
`fsutil volume list`
|
||||
|
||||
- Display information about a volume's file system:
|
||||
|
||||
`fsutil fsInfo volumeInfo {{drive_letter|volume_path}}`
|
||||
|
||||
- Display the current state of the file system auto-repair for all volumes:
|
||||
|
||||
`fsutil repair state`
|
||||
|
||||
- Display the dirty bit state of all volumes:
|
||||
|
||||
`fsutil dirty query`
|
||||
|
||||
- Set the dirty bit state of a volume:
|
||||
|
||||
`fsutil dirty set {{drive_letter|volume_path}}`
|
||||
41
tldr/windows/ftp
Normal file
41
tldr/windows/ftp
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ftp
|
||||
|
||||
> Interactively transfer files between a local and remote FTP server.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/ftp>.
|
||||
|
||||
- Connect to a remote FTP server interactively:
|
||||
|
||||
`ftp {{host}}`
|
||||
|
||||
- Log in as an anonymous user:
|
||||
|
||||
`ftp -A {{host}}`
|
||||
|
||||
- Disable automatic login upon initial connection:
|
||||
|
||||
`ftp -n {{host}}`
|
||||
|
||||
- Run a file containing a list of FTP commands:
|
||||
|
||||
`ftp -s:{{path oile}} {{host}}`
|
||||
|
||||
- Download multiple files (glob expression):
|
||||
|
||||
`mget {{*.png}}`
|
||||
|
||||
- Upload multiple files (glob expression):
|
||||
|
||||
`mput {{*.zip}}`
|
||||
|
||||
- Delete multiple files on the remote server:
|
||||
|
||||
`mdelete {{*.txt}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`ftp --help`
|
||||
21
tldr/windows/ftype
Normal file
21
tldr/windows/ftype
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ftype
|
||||
|
||||
> Display or modify file types used for file extension association.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/ftype>.
|
||||
|
||||
- Display a list of all file types:
|
||||
|
||||
`ftype`
|
||||
|
||||
- Display the associated program for a specific file type:
|
||||
|
||||
`ftype {{file_type}}`
|
||||
|
||||
- Set the associated program for a specific file type:
|
||||
|
||||
`ftype {{file_type}}="{{path/to/executable_file}}"`
|
||||
13
tldr/windows/gal
Normal file
13
tldr/windows/gal
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# gal
|
||||
|
||||
> In PowerShell, this command is an alias of `Get-Alias`.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-alias>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr get-alias`
|
||||
18
tldr/windows/get-acl
Normal file
18
tldr/windows/get-acl
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Acl
|
||||
|
||||
> Gets the security descriptor for a resource, such as a file or registry key.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.security/get-acl>.
|
||||
|
||||
- Display the ACL for a specific directory:
|
||||
|
||||
`Get-Acl {{path o\directory}}`
|
||||
|
||||
- Get an ACL for a registry key:
|
||||
|
||||
`Get-Acl -Path {{HKLM:\System\CurrentControlSet\Control}} | Format-List`
|
||||
26
tldr/windows/get-alias
Normal file
26
tldr/windows/get-alias
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Alias
|
||||
|
||||
> List and get command aliases in the current PowerShell session.
|
||||
> This command can only be run under PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-alias>.
|
||||
|
||||
- List all aliases in the current session:
|
||||
|
||||
`Get-Alias`
|
||||
|
||||
- Get the aliased command name:
|
||||
|
||||
`Get-Alias {{command_alias}}`
|
||||
|
||||
- List all aliases assigned to a specific command:
|
||||
|
||||
`Get-Alias -Definition {{command}}`
|
||||
|
||||
- List aliases that begins with `abc`, excluding those which ends at `def`:
|
||||
|
||||
`Get-Alias {{abc}}* -Exclude *{{def}}`
|
||||
30
tldr/windows/get-childitem
Normal file
30
tldr/windows/get-childitem
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-ChildItem
|
||||
|
||||
> List items in a directory.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-childitem>.
|
||||
|
||||
- List all non-hidden items in the current directory:
|
||||
|
||||
`Get-ChildItem`
|
||||
|
||||
- List only directories in the current directory:
|
||||
|
||||
`Get-ChildItem -Directory`
|
||||
|
||||
- List only files in the current directory:
|
||||
|
||||
`Get-ChildItem -File`
|
||||
|
||||
- List items in the current directory, including hidden items:
|
||||
|
||||
`Get-ChildItem -Hidden`
|
||||
|
||||
- List items in a directory other than the current one:
|
||||
|
||||
`Get-ChildItem -Path {{path o\directory}}`
|
||||
34
tldr/windows/get-command
Normal file
34
tldr/windows/get-command
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Command
|
||||
|
||||
> List and get available commands in the current PowerShell session.
|
||||
> This command can only be run through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-command>.
|
||||
|
||||
- List all available PowerShell commands (aliases, cmdlets, functions) in the current computer:
|
||||
|
||||
`Get-Command`
|
||||
|
||||
- List all available PowerShell commands in the current session:
|
||||
|
||||
`Get-Command -ListImported`
|
||||
|
||||
- List only PowerShell aliases/cmdlets/functions available in the computer:
|
||||
|
||||
`Get-Command -Type {{Alias|Cmdlet|Function}}`
|
||||
|
||||
- List only programs or commands available on PATH in the current session:
|
||||
|
||||
`Get-Command -Type Application`
|
||||
|
||||
- List only PowerShell commands by the module name, e.g. `Microsoft.PowerShell.Utility` for utility-related commands:
|
||||
|
||||
`Get-Command -Module {{module}}`
|
||||
|
||||
- Get the command information (e.g. version number or module name) by its name:
|
||||
|
||||
`Get-Command {{command}}`
|
||||
22
tldr/windows/get-content
Normal file
22
tldr/windows/get-content
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Content
|
||||
|
||||
> Get the content of the item at the specified location.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-content>.
|
||||
|
||||
- Display the content of a file:
|
||||
|
||||
`Get-Content -Path {{path oile}}`
|
||||
|
||||
- Display the first few lines of a file:
|
||||
|
||||
`Get-Content -Path {{path oile}} -TotalCount {{10}}`
|
||||
|
||||
- Display the content of the file and keep reading from it until `Ctrl + C` is pressed:
|
||||
|
||||
`Get-Content -Path {{path oile}} -Wait`
|
||||
26
tldr/windows/get-date
Normal file
26
tldr/windows/get-date
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Date
|
||||
|
||||
> Gets the current date and time.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-date>.
|
||||
|
||||
- Display the current date and time:
|
||||
|
||||
`Get-Date`
|
||||
|
||||
- Display the current date and time with a .NET format specifier:
|
||||
|
||||
`Get-Date -Format "{{yyyy-MM-dd HH:mm:ss}}"`
|
||||
|
||||
- Display the current date and time in UTC and ISO 8601 format:
|
||||
|
||||
`(Get-Date).ToUniversalTime()`
|
||||
|
||||
- Convert a Unix timestamp:
|
||||
|
||||
`Get-Date -UnixTimeSeconds {{1577836800}}`
|
||||
18
tldr/windows/get-filehash
Normal file
18
tldr/windows/get-filehash
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-FileHash
|
||||
|
||||
> Calculate a hash for a file.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-filehash>.
|
||||
|
||||
- Calculate a hash for a specified file using the SHA256 algorithm:
|
||||
|
||||
`Get-FileHash {{path oile}}`
|
||||
|
||||
- Calculate a hash for a specified file using a specified algorithm:
|
||||
|
||||
`Get-FileHash {{path oile}} -Algorithm {{SHA1|SHA384|SHA256|SHA512|MD5}}`
|
||||
42
tldr/windows/get-help
Normal file
42
tldr/windows/get-help
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Help
|
||||
|
||||
> Display help information and documentation for PowerShell commands (aliases, cmdlets, and functions).
|
||||
> This command can only be run through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-help>.
|
||||
|
||||
- Display general help information for a specific PowerShell command:
|
||||
|
||||
`Get-Help {{command}}`
|
||||
|
||||
- Display a more detailed documentation for a specific PowerShell command:
|
||||
|
||||
`Get-Help {{command}} -Detailed`
|
||||
|
||||
- Display the full technical documentation for a specific PowerShell command:
|
||||
|
||||
`Get-Help {{command}} -Full`
|
||||
|
||||
- Print only the documentation for a specific parameter of the PowerShell command (use `*` to show all parameters), if available:
|
||||
|
||||
`Get-Help {{command}} -Parameter {{parameter}}`
|
||||
|
||||
- Print only the examples of the cmdlet, if available:
|
||||
|
||||
`Get-Help {{command}} -Examples`
|
||||
|
||||
- List all available cmdlet help pages:
|
||||
|
||||
`Get-Help *`
|
||||
|
||||
- Update the current help and documentation knowledge base using `Update-Help`:
|
||||
|
||||
`Update-Help`
|
||||
|
||||
- View an online version of PowerShell command documentation in the default web browser:
|
||||
|
||||
`Get-Help {{command}} -Online`
|
||||
22
tldr/windows/get-history
Normal file
22
tldr/windows/get-history
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-History
|
||||
|
||||
> Display PowerShell command history.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-history>.
|
||||
|
||||
- Display the commands history list with ID:
|
||||
|
||||
`Get-History`
|
||||
|
||||
- Get PowerShell history item by ID:
|
||||
|
||||
`Get-History -Id {{id}}`
|
||||
|
||||
- Display the last N commands:
|
||||
|
||||
`Get-History -Count {{10}}`
|
||||
14
tldr/windows/get-location
Normal file
14
tldr/windows/get-location
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-Location
|
||||
|
||||
> Print name of current/working directory.
|
||||
> This command can only be run through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-location>.
|
||||
|
||||
- Print the current directory:
|
||||
|
||||
`Get-Location`
|
||||
18
tldr/windows/get-wuapiversion
Normal file
18
tldr/windows/get-wuapiversion
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-WUApiVersion
|
||||
|
||||
> Get the Windows Update Agent version. Part of external `PSWindowsUpdate` module.
|
||||
> This command can only be run under PowerShell.
|
||||
> More information: <https://github.com/mgajda83/PSWindowsUpdate>.
|
||||
|
||||
- Get the currently-installed Windows Update Agent version:
|
||||
|
||||
`Get-WUApiVersion`
|
||||
|
||||
- Send the current configuration data via email (SMTP):
|
||||
|
||||
`Get-WUApiVersion -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
||||
30
tldr/windows/get-wuhistory
Normal file
30
tldr/windows/get-wuhistory
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-WUHistory
|
||||
|
||||
> Get the history of installed updates from Windows Update. Part of external `PSWindowsUpdate` module.
|
||||
> This command can only be run under PowerShell.
|
||||
> More information: <https://github.com/mgajda83/PSWindowsUpdate>.
|
||||
|
||||
- Get list of update history:
|
||||
|
||||
`Get-WUHistory`
|
||||
|
||||
- List the last 10 installed updates:
|
||||
|
||||
`Get-WUHistory -Last {{10}}`
|
||||
|
||||
- List all updates installed from a specific date to today:
|
||||
|
||||
`Get-WUHistory -MaxDate {{date}}`
|
||||
|
||||
- List all updates installed in the past 24 hours:
|
||||
|
||||
`Get-WUHistory -MaxDate (Get-Date).AddDays(-1)`
|
||||
|
||||
- Send the results via email (SMTP):
|
||||
|
||||
`Get-WUHistory -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
||||
18
tldr/windows/get-wusettings
Normal file
18
tldr/windows/get-wusettings
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Get-WUSettings
|
||||
|
||||
> Get the current Windows Update Agent configuration. Part of external `PSWindowsUpdate` module.
|
||||
> This command can only be run under PowerShell.
|
||||
> More information: <https://github.com/mgajda83/PSWindowsUpdate>.
|
||||
|
||||
- Get the current Windows Update Agent configuration:
|
||||
|
||||
`Get-WUSettings`
|
||||
|
||||
- Send the current configuration data via email (SMTP):
|
||||
|
||||
`Get-WUSettings -SendReport -PSWUSettings @{SmtpServer="{{smtp_server}}"; Port={{smtp_port}} From="{{sender_email}}" To="{{receiver_email}}"}`
|
||||
33
tldr/windows/getmac
Normal file
33
tldr/windows/getmac
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# getmac
|
||||
|
||||
> Display the MAC addresses of a system.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/getmac>.
|
||||
|
||||
- Display the MAC addresses for the current system:
|
||||
|
||||
`getmac`
|
||||
|
||||
- Display the details in a specific format:
|
||||
|
||||
`getmac /fo {{table|list|csv}}`
|
||||
|
||||
- Exclude the header in the output list:
|
||||
|
||||
`getmac /nh`
|
||||
|
||||
- Display the MAC addresses for a remote machine:
|
||||
|
||||
`getmac /s {{hostname}} /u {{username}} /p {{password}}`
|
||||
|
||||
- Display the MAC addresses with verbose information:
|
||||
|
||||
`getmac /v`
|
||||
|
||||
- Display help:
|
||||
|
||||
`getmac /?`
|
||||
13
tldr/windows/gl
Normal file
13
tldr/windows/gl
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# gl
|
||||
|
||||
> In PowerShell, this command is an alias of `Get-Location`.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-location>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr get-location`
|
||||
25
tldr/windows/gpupdate
Normal file
25
tldr/windows/gpupdate
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# gpupdate
|
||||
|
||||
> A tool to check and apply Windows Group Policy settings.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/gpupdate>.
|
||||
|
||||
- Check and apply updated Group Policy settings:
|
||||
|
||||
`gpupdate`
|
||||
|
||||
- Specify the target Group Policy settings to check for update:
|
||||
|
||||
`gpupdate /target:{{computer|user}}`
|
||||
|
||||
- Force all Group Policy settings to be reapplied:
|
||||
|
||||
`gpupdate /force`
|
||||
|
||||
- Display help:
|
||||
|
||||
`gpupdate /?`
|
||||
37
tldr/windows/if
Normal file
37
tldr/windows/if
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# if
|
||||
|
||||
> Performs conditional processing in batch scripts.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/if>.
|
||||
|
||||
- Execute the specified commands if the condition is true:
|
||||
|
||||
`if {{condition}} ({{echo Condition is true}})`
|
||||
|
||||
- Execute the specified commands if the condition is false:
|
||||
|
||||
`if not {{condition}} ({{echo Condition is true}})`
|
||||
|
||||
- Execute the first specified commands if the condition is true otherwise execute the second specified commands:
|
||||
|
||||
`if {{condition}} ({{echo Condition is true}}) else ({{echo Condition is false}})`
|
||||
|
||||
- Check whether `%errorlevel%` is greater than or equal to the specified exit code:
|
||||
|
||||
`if errorlevel {{2}} ({{echo Condition is true}})`
|
||||
|
||||
- Check whether two strings are equal:
|
||||
|
||||
`if %{{variable}}% == {{string}} ({{echo Condition is true}})`
|
||||
|
||||
- Check whether two strings are equal without respecting letter case:
|
||||
|
||||
`if /i %{{variable}}% == {{string}} ({{echo Condition is true}})`
|
||||
|
||||
- Check whether a file exist:
|
||||
|
||||
`if exist {{path oile}} ({{echo Condition is true}})`
|
||||
41
tldr/windows/install-module
Normal file
41
tldr/windows/install-module
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Install-Module
|
||||
|
||||
> Install PowerShell modules from PowerShell Gallery, NuGet, and other repositories.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/powershellget/install-module>.
|
||||
|
||||
- Install a module, or update it to the latest available version:
|
||||
|
||||
`Install-Module {{module}}`
|
||||
|
||||
- Install a module with a specific version:
|
||||
|
||||
`Install-Module {{module}} -RequiredVersion {{version}}`
|
||||
|
||||
- Install a module no earlier than a specific version:
|
||||
|
||||
`Install-Module {{module}} -MinimumVersion {{version}}`
|
||||
|
||||
- Specify a range of supported versions (inclusive) of the required module:
|
||||
|
||||
`Install-Module {{module}} -MinimumVersion {{minimum_version}} -MaximumVersion {{maximum_version}}`
|
||||
|
||||
- Install module from a specific repository:
|
||||
|
||||
`Install-Module {{module}} -Repository {{repository}}`
|
||||
|
||||
- Install module from specific repositories:
|
||||
|
||||
`Install-Module {{module}} -Repository {{repository1 , repository2 , ...}}`
|
||||
|
||||
- Install the module for all/current user:
|
||||
|
||||
`Install-Module {{module}} -Scope {{AllUsers|CurrentUser}}`
|
||||
|
||||
- Perform a dry run to determine which modules will be installed, upgraded, or removed through `Install-Module`:
|
||||
|
||||
`Install-Module {{module}} -WhatIf`
|
||||
34
tldr/windows/invoke-item
Normal file
34
tldr/windows/invoke-item
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Invoke-Item
|
||||
|
||||
> Open files in their respective default programs.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/invoke-item>.
|
||||
|
||||
- Open a file in its default program:
|
||||
|
||||
`Invoke-Item -Path {{path oile}}`
|
||||
|
||||
- Open all files inside a directory:
|
||||
|
||||
`Invoke-Item -Path {{path o\directory}}\*`
|
||||
|
||||
- Open all PNGs inside a directory:
|
||||
|
||||
`Invoke-Item -Path {{path o\directory}}\*.png`
|
||||
|
||||
- Open all files inside a directory containing a specific keyword:
|
||||
|
||||
`Invoke-Item -Path {{path o\directory}}\* -Include {{*keyword*}}`
|
||||
|
||||
- Open all files inside a directory except those containing a specific keyword:
|
||||
|
||||
`Invoke-Item -Path {{path o\directory}}\* -Exclude {{*keyword*}}`
|
||||
|
||||
- Perform a dry run to determine which files will be opened inside a directory through `Invoke-Item`:
|
||||
|
||||
`Invoke-Item -Path {{path o\directory}}\* -WhatIf`
|
||||
30
tldr/windows/invoke-webrequest
Normal file
30
tldr/windows/invoke-webrequest
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Invoke-WebRequest
|
||||
|
||||
> Performs a HTTP/HTTPS request to the Web.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>.
|
||||
|
||||
- Download the contents of a URL to a file:
|
||||
|
||||
`Invoke-WebRequest {{http://example.com}} -OutFile {{path oile}}`
|
||||
|
||||
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`):
|
||||
|
||||
`Invoke-WebRequest -Method Post -Body @{ name='bob' } {{http://example.com/form}}`
|
||||
|
||||
- Send a request with an extra header, using a custom HTTP method:
|
||||
|
||||
`Invoke-WebRequest -Headers {{@{ X-My-Header = '123' }}} -Method {{PUT}} {{http://example.com}}`
|
||||
|
||||
- Send data in JSON format, specifying the appropriate content-type header:
|
||||
|
||||
`Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}`
|
||||
|
||||
- Pass a username and password for server authentication:
|
||||
|
||||
`Invoke-WebRequest -Headers @{ Authorization = "Basic "+ [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("myusername:mypassword")) } {{http://example.com}}`
|
||||
33
tldr/windows/ipconfig
Normal file
33
tldr/windows/ipconfig
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ipconfig
|
||||
|
||||
> Display and manage the network configuration of Windows.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/ipconfig>.
|
||||
|
||||
- List all network adapters:
|
||||
|
||||
`ipconfig`
|
||||
|
||||
- Show a detailed list of network adapters:
|
||||
|
||||
`ipconfig /all`
|
||||
|
||||
- Renew the IP addresses for a network adapter:
|
||||
|
||||
`ipconfig /renew {{adapter}}`
|
||||
|
||||
- Free up the IP addresses for a network adapter:
|
||||
|
||||
`ipconfig /release {{adapter}}`
|
||||
|
||||
- Show the local DNS cache:
|
||||
|
||||
`ipconfig /displaydns`
|
||||
|
||||
- Remove all data from the local DNS cache:
|
||||
|
||||
`ipconfig /flushdns`
|
||||
22
tldr/windows/iscc
Normal file
22
tldr/windows/iscc
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# iscc
|
||||
|
||||
> Compiler for Inno Setup installers.
|
||||
> It compiles an Inno Setup scripts into an Windows installer executable.
|
||||
> More information: <https://jrsoftware.org/isinfo.php>.
|
||||
|
||||
- Compile an Inno Setup script:
|
||||
|
||||
`iscc {{path oile.iss}}`
|
||||
|
||||
- Quietly compile an Inno Setup installer:
|
||||
|
||||
`iscc /Q {{path oile.iss}}`
|
||||
|
||||
- Compile a signed Inno Setup installer:
|
||||
|
||||
`iscc /S={{name}}={{command}} {{path oile.iss}}`
|
||||
13
tldr/windows/iwr
Normal file
13
tldr/windows/iwr
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# iwr
|
||||
|
||||
> In PowerShell, this command is an alias of `Invoke-WebRequest`.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr invoke-webrequest`
|
||||
21
tldr/windows/logoff
Normal file
21
tldr/windows/logoff
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# logoff
|
||||
|
||||
> Terminate a login session.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/logoff>.
|
||||
|
||||
- Terminate the current session:
|
||||
|
||||
`logoff`
|
||||
|
||||
- Terminate a session by its name or id:
|
||||
|
||||
`logoff {{session_name|session_id}}`
|
||||
|
||||
- Terminate a session on a specific server connected through RDP:
|
||||
|
||||
`logoff {{session_name|session_id}} /server:{{servername}}`
|
||||
18
tldr/windows/measure-command
Normal file
18
tldr/windows/measure-command
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Measure-Command
|
||||
|
||||
> Measures the time it takes to run script blocks and cmdlets.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/measure-command>.
|
||||
|
||||
- Measure the time it takes to run a command:
|
||||
|
||||
`Measure-Command { {{command}} }`
|
||||
|
||||
- Pipe input to Measure-Command (objects that are piped to `Measure-Command` are available to the script block that is passed to the Expression parameter):
|
||||
|
||||
`10, 20, 50 | Measure-Command -Expression { for ($i=0; $i -lt $_; $i++) {$i} }`
|
||||
18
tldr/windows/measure-object
Normal file
18
tldr/windows/measure-object
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Measure-Object
|
||||
|
||||
> Calculates the numeric properties of objects, and the characters, words, and lines in string objects, such as files of text.
|
||||
> This command can only be used through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/measure-object>.
|
||||
|
||||
- Count the files and folders in a directory:
|
||||
|
||||
`Get-ChildItem | Measure-Object`
|
||||
|
||||
- Pipe input to Measure-Command (objects that are piped to `Measure-Command` are available to the script block that is passed to the Expression parameter):
|
||||
|
||||
`"One", "Two", "Three", "Four" | Set-Content -Path "{{path oile}}"; Get-Content "{{path oile}}"; | Measure-Object -Character -Line -Word`
|
||||
13
tldr/windows/mi
Normal file
13
tldr/windows/mi
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mi
|
||||
|
||||
> In PowerShell, this command is an alias of `Move-Item`.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item>.
|
||||
|
||||
- View documentation for the original command:
|
||||
|
||||
`tldr move-item`
|
||||
17
tldr/windows/mkdir
Normal file
17
tldr/windows/mkdir
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mkdir
|
||||
|
||||
> Creates a directory.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/mkdir>.
|
||||
|
||||
- Create a directory:
|
||||
|
||||
`mkdir {{path o\directory}}`
|
||||
|
||||
- Create a nested directory tree recursively:
|
||||
|
||||
`mkdir {{path o\sub_directory}}`
|
||||
25
tldr/windows/mklink
Normal file
25
tldr/windows/mklink
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mklink
|
||||
|
||||
> Create symbolic links.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/mklink>.
|
||||
|
||||
- Create a symbolic link to a file:
|
||||
|
||||
`mklink {{path o\link_file}} {{path o\source_file}}`
|
||||
|
||||
- Create a symbolic link to a directory:
|
||||
|
||||
`mklink /d {{path o\link_file}} {{path o\source_directory}}`
|
||||
|
||||
- Create a hard link to a file:
|
||||
|
||||
`mklink /h {{path o\link_file}} {{path o\source_file}}`
|
||||
|
||||
- Create a directory junction:
|
||||
|
||||
`mklink /j {{path o\link_file}} {{path o\source_file}}`
|
||||
37
tldr/windows/more
Normal file
37
tldr/windows/more
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# more
|
||||
|
||||
> Display paginated output from `stdin` or a file.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/more>.
|
||||
|
||||
- Display paginated output from `stdin`:
|
||||
|
||||
`{{echo test}} | more`
|
||||
|
||||
- Display paginated output from one or more files:
|
||||
|
||||
`more {{path oile}}`
|
||||
|
||||
- Convert tabs to the specified number of spaces:
|
||||
|
||||
`more {{path oile}} /t{{spaces}}`
|
||||
|
||||
- Clear the screen before displaying the page:
|
||||
|
||||
`more {{path oile}} /c`
|
||||
|
||||
- Display the output starting at line 5:
|
||||
|
||||
`more {{path oile}} +{{5}}`
|
||||
|
||||
- Enable extended interactive mode (see help for usage):
|
||||
|
||||
`more {{path oile}} /e`
|
||||
|
||||
- Display help:
|
||||
|
||||
`more /?`
|
||||
37
tldr/windows/mount
Normal file
37
tldr/windows/mount
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mount
|
||||
|
||||
> Mount Network File System (NFS) network shares.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/mount>.
|
||||
|
||||
- Mount a share to the "Z" drive letter:
|
||||
|
||||
`mount \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
|
||||
- Mount a share to the next available drive letter:
|
||||
|
||||
`mount \{{computer_name}}\{{share_name}} *`
|
||||
|
||||
- Mount a share with a read timeout in seconds (defaults to 0.8, can be 0.9 or 1 to 60):
|
||||
|
||||
`mount -o timeout={{seconds}} \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
|
||||
- Mount a share and retry up to 10 times if it fails:
|
||||
|
||||
`mount -o retry={{retries}} \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
|
||||
- Mount a share with forced case sensitivity:
|
||||
|
||||
`mount -o casesensitive \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
|
||||
- Mount a share as an anonymous user:
|
||||
|
||||
`mount -o anon \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
|
||||
- Mount a share using a specific mount type:
|
||||
|
||||
`mount -o mtype={{soft|hard}} \{{computer_name}}\{{share_name}} {{Z:}}`
|
||||
34
tldr/windows/move
Normal file
34
tldr/windows/move
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# move
|
||||
|
||||
> Move or rename files and directories.
|
||||
> In PowerShell, this command is an alias of `Move-Item`. This documentation is based on the Command Prompt (`cmd`) version of `move`.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/move>.
|
||||
|
||||
- View documentation of the equivalent PowerShell command:
|
||||
|
||||
`tldr move-item`
|
||||
|
||||
- Rename a file or directory when the target is not an existing directory:
|
||||
|
||||
`move {{path o\source}} {{path o arget}}`
|
||||
|
||||
- Move a file or directory into an existing directory:
|
||||
|
||||
`move {{path o\source}} {{path oxisting_directory}}`
|
||||
|
||||
- Move a file or directory across drives:
|
||||
|
||||
`move {{C:\path o\source}} {{D:\path o arget}}`
|
||||
|
||||
- Do not prompt for confirmation before overwriting existing files:
|
||||
|
||||
`move /Y {{path o\source}} {{path oxisting_directory}}`
|
||||
|
||||
- Prompt for confirmation before overwriting existing files, regardless of file permissions:
|
||||
|
||||
`move /-Y {{path o\source}} {{path oxisting_directory}}`
|
||||
43
tldr/windows/move-item
Normal file
43
tldr/windows/move-item
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# Move-Item
|
||||
|
||||
> Move or rename files, directories, registry keys, and other PowerShell data items.
|
||||
> This command can only be run through PowerShell.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item>.
|
||||
|
||||
- Rename a file or directory when the target is not an existing directory:
|
||||
|
||||
`Move-Item {{path o\source}} {{path o arget}}`
|
||||
|
||||
- Move a file or directory into an existing directory:
|
||||
|
||||
`Move-Item {{path o\source}} {{path oxisting_directory}}`
|
||||
|
||||
- Rename or move file(s) with specific name (do not treat special characters inside strings):
|
||||
|
||||
`Move-Item -LiteralPath "{{path o\source}}" {{path oile_or_directory}}`
|
||||
|
||||
- Move multiple files into an existing directory, keeping the filenames unchanged:
|
||||
|
||||
`Move-Item {{path o\source1 , path o\source2 ...}} {{path oxisting_directory}}`
|
||||
|
||||
- Move or rename registry key(s):
|
||||
|
||||
`Move-Item {{path o\source_key1 , path o\source_key2 ...}} {{path o
|
||||
ew_or_existing_key}}`
|
||||
|
||||
- Do not prompt for confirmation before overwriting existing files or registry keys:
|
||||
|
||||
`mv -Force {{path o\source}} {{path o arget}}`
|
||||
|
||||
- Prompt for confirmation before overwriting existing files, regardless of file permissions:
|
||||
|
||||
`mv -Confirm {{path o\source}} {{path o arget}}`
|
||||
|
||||
- Move files in dry-run mode, showing files and directories which could be moved without executing them:
|
||||
|
||||
`mv -WhatIf {{path o\source}} {{path o arget}}`
|
||||
29
tldr/windows/msg
Normal file
29
tldr/windows/msg
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# msg
|
||||
|
||||
> Send a message to a user or session.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/msg>.
|
||||
|
||||
- Send a message to a specified user or session:
|
||||
|
||||
`msg {{username|session_name|session_id}} {{message}}`
|
||||
|
||||
- Send a message from `stdin`:
|
||||
|
||||
`echo "{{message}}" | msg {{username|session_name|session_id}}`
|
||||
|
||||
- Send a message to a specific server:
|
||||
|
||||
`msg /server:{{server_name}} {{username|session_name|session_id}}`
|
||||
|
||||
- Send a message to all users of the current machine:
|
||||
|
||||
`msg *`
|
||||
|
||||
- Set a delay in seconds for a message:
|
||||
|
||||
`msg /time:{{10}}`
|
||||
25
tldr/windows/msiexec
Normal file
25
tldr/windows/msiexec
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# msiexec
|
||||
|
||||
> Install, update, repair, or uninstall Windows programs using MSI and MSP package files.
|
||||
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/msiexec>.
|
||||
|
||||
- Install a program from its MSI package:
|
||||
|
||||
`msiexec /package {{path oile.msi}}`
|
||||
|
||||
- Install a MSI package from a website:
|
||||
|
||||
`msiexec /package {{https://example.com/installer.msi}}`
|
||||
|
||||
- Install a MSP patch file:
|
||||
|
||||
`msiexec /update {{path oile.msp}}`
|
||||
|
||||
- Uninstall a program or patch using their respective MSI or MSP file:
|
||||
|
||||
`msiexec /uninstall {{path oile}}`
|
||||
18
tldr/windows/mv
Normal file
18
tldr/windows/mv
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, windows]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# mv
|
||||
|
||||
> In PowerShell, this command is an alias of `Move-Item`.
|
||||
> However, this command is not available on the Command Prompt (`cmd`). Use `move` instead for similar functionality.
|
||||
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/move-item>.
|
||||
|
||||
- View documentation for the equivalent Command Prompt command:
|
||||
|
||||
`tldr move`
|
||||
|
||||
- View documentation for the original PowerShell command:
|
||||
|
||||
`tldr move-item`
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user