diff --git a/pages/windows/clear-host.md b/pages/windows/clear-host.md new file mode 100644 index 0000000000..910cd97865 --- /dev/null +++ b/pages/windows/clear-host.md @@ -0,0 +1,9 @@ +# Clear-Host + +> Clears the screen. +> This command can only be used through PowerShell. +> More information: . + +- Clear the screen: + +`cls` diff --git a/pages/windows/clear-recyclebin.md b/pages/windows/clear-recyclebin.md new file mode 100644 index 0000000000..87665c8a39 --- /dev/null +++ b/pages/windows/clear-recyclebin.md @@ -0,0 +1,17 @@ +# 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: . + +- 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` diff --git a/pages/windows/clear.md b/pages/windows/clear.md new file mode 100644 index 0000000000..b5edc66642 --- /dev/null +++ b/pages/windows/clear.md @@ -0,0 +1,7 @@ +# clear + +> In PowerShell, this command is an alias of `Clear-Host`. + +- View documentation for the original command: + +`tldr clear-host` diff --git a/pages/windows/cls.md b/pages/windows/cls.md index 508aca970e..62ac428cc3 100644 --- a/pages/windows/cls.md +++ b/pages/windows/cls.md @@ -1,8 +1,13 @@ # 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: . +- View the documentation of the equivalent PowerShell command: + +`tldr clear-host` + - Clear the screen: `cls` diff --git a/pages/windows/curl.md b/pages/windows/curl.md index 6742bdebda..28b7a56e57 100644 --- a/pages/windows/curl.md +++ b/pages/windows/curl.md @@ -1,6 +1,7 @@ # curl > In PowerShell, this command may be an alias of `Invoke-WebRequest` when the original `curl` program () is not properly installed. +> More information: . - 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`: diff --git a/pages/windows/del.md b/pages/windows/del.md index ec97f435aa..a47affa786 100644 --- a/pages/windows/del.md +++ b/pages/windows/del.md @@ -1,8 +1,13 @@ # 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: . +- View the documentation of the equivalent PowerShell command: + +`tldr remove-item` + - Delete one or more space-separated files or patterns: `del {{file_pattern}}` diff --git a/pages/windows/gal.md b/pages/windows/gal.md new file mode 100644 index 0000000000..11336adc4e --- /dev/null +++ b/pages/windows/gal.md @@ -0,0 +1,8 @@ +# gal + +> In PowerShell, this command is an alias of `Get-Alias`. +> More information: . + +- View documentation for the original command: + +`tldr get-alias` diff --git a/pages/windows/get-alias.md b/pages/windows/get-alias.md new file mode 100644 index 0000000000..2f06231c7d --- /dev/null +++ b/pages/windows/get-alias.md @@ -0,0 +1,21 @@ +# Get-Alias + +> List and get command aliases in the current PowerShell session. +> This command can only be run under PowerShell. +> More information: . + +- 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}}` diff --git a/pages/windows/get-help.md b/pages/windows/get-help.md new file mode 100644 index 0000000000..8ae34b4d9d --- /dev/null +++ b/pages/windows/get-help.md @@ -0,0 +1,37 @@ +# Get-Help + +> Display help information and documentation for PowerShell commands, aka. cmdlets. +> This command can only be run through PowerShell. +> More information: . + +- Display general help information for a specific cmdlet: + +`Get-Help {{cmdlet}}` + +- Display a more detailed documentation for a specific cmdlet: + +`Get-Help {{cmdlet}} -Detailed` + +- Display the full technical documentation for a specific cmdlet: + +`Get-Help {{cmdlet}} -Full` + +- Print only the documentation for a specific parameter of the cmdlet (use `*` to show all parameters), if available: + +`Get-Help {{cmdlet}} -Parameter {{parameter}}` + +- Print only the examples of the cmdlet, if available: + +`Get-Help {{cmdlet}} -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 cmdlet documentation in the default web browser: + +`Get-Help {{cmdlet}} -Online` diff --git a/pages/windows/iwr.md b/pages/windows/iwr.md index 5a008a7e45..09199dc69d 100644 --- a/pages/windows/iwr.md +++ b/pages/windows/iwr.md @@ -1,6 +1,7 @@ # iwr -> This command is an alias of `Invoke-WebRequest` in PowerShell. +> In PowerShell, this command is an alias of `Invoke-WebRequest`. +> More information: . - View documentation for the original command: diff --git a/pages/windows/new-item.md b/pages/windows/new-item.md new file mode 100644 index 0000000000..5bf4d9f071 --- /dev/null +++ b/pages/windows/new-item.md @@ -0,0 +1,33 @@ +# New-Item + +> Create a new file, directory, symbolic link, or a registry entry. +> This command can only be used through PowerShell. +> More information: . + +- Create a new blank file (equivalent to `touch`): + +`New-Item {{path\to\file}}` + +- Create a new directory: + +`New-Item -ItemType Directory {{path\to\directory}}` + +- Write a new text file with specified content: + +`New-Item {{path\to\file}} -Value {{content}}` + +- Write the same text file in multiple locations: + +`New-Item {{path\to\file1 , path\to\file2 , ...}} -Value {{content}}` + +- Create a symbolic link\hard link\junction to a file or directory: + +`New-Item -ItemType {{SymbolicLink|HardLink|Junction}} -Path {{path\to\link_file}} -Target {{path\to\source_file_or_directory}}` + +- Create a new blank registry entry (in REG_SZ, use `New-ItemProperty` or `Set-ItemProperty` to fine-tune the value type): + +`New-Item {{path\to\registry_key}}` + +- Create a new blank registry entry with specified value: + +`New-Item {{path\to\registry_key}} -Value {{value}}` diff --git a/pages/windows/ni.md b/pages/windows/ni.md new file mode 100644 index 0000000000..106c43273d --- /dev/null +++ b/pages/windows/ni.md @@ -0,0 +1,8 @@ +# ni + +> In PowerShell, this command is an alias of `New-Item`. +> More information: . + +- View documentation for the original command: + +`tldr new-item` diff --git a/pages/windows/psversiontable.md b/pages/windows/psversiontable.md new file mode 100644 index 0000000000..b7faa5451c --- /dev/null +++ b/pages/windows/psversiontable.md @@ -0,0 +1,25 @@ +# PSVersionTable + +> A read-only variable (as `$PSVersionTable`) to get the current PowerShell version. +> This command can only be run under PowerShell. +> More information: . + +- Print a summary of the currently installed PowerShell version and edition: + +`$PSVersionTable` + +- Get the detailed (major, minor, build, and revision) version number of PowerShell: + +`$PSVersionTable.PSVersion` + +- Get a list of supported PowerShell script versions that this PowerShell version supports: + +`$PSVersionTable.PSCompatibleVersions` + +- Get the latest Git commit ID where the currently-installed PowerShell version is based on (works on PowerShell 6.0 and later): + +`$PSVersionTable.GitCommitId` + +- Check whether the user is running PowerShell Core (6.0 or later) or the original "Windows PowerShell" (version 5.1 or below): + +`$PSVersionTable.PSEdition` diff --git a/pages/windows/rd.md b/pages/windows/rd.md index 4deed77672..fe9d468329 100644 --- a/pages/windows/rd.md +++ b/pages/windows/rd.md @@ -1,8 +1,12 @@ # rd -> This command is an alias of `rmdir`. +> This command is an alias of `rmdir` on Command Prompt, and subsequently `Remove-Item` in PowerShell. > More information: . -- View documentation for the original command: +- View documentation for the original Command Prompt command: `tldr rmdir` + +- View documentation for the original PowerShell command: + +`tldr remove-item` diff --git a/pages/windows/remove-item.md b/pages/windows/remove-item.md new file mode 100644 index 0000000000..108511e703 --- /dev/null +++ b/pages/windows/remove-item.md @@ -0,0 +1,29 @@ +# Remove-Item + +> Delete files, folders, as well as registry keys and subkeys. +> This command can only be run through PowerShell. +> More information: . + +- Remove specific files or registry keys (without subkeys): + +`Remove-Item {{path\to\file_or_key1 path\to\file_or_key2 ...}}` + +- Remove hidden or read-only files: + +`Remove-Item -Force {{path\to\file1 path\to\file2 ...}}` + +- Remove specific files or registry keys interactively prompting before each removal: + +`Remove-Item -Confirm {{path\to\file_or_key1 path\to\file_or_key2 ...}}` + +- Remove specific files and directories recursively (Windows 10 version 1909 or later): + +`Remove-Item -Recurse {{path\to\file_or_directory1 path\to\file_or_directory2 ...}}` + +- Remove specific Windows registry keys and all its subkeys: + +`Remove-Item -Recurse {{path\to\key1 path\to\key2 ...}}` + +- Perform a dry run of the deletion process: + +`Remove-Item -WhatIf {{path\to\file1 path\to\file2 ...}}` diff --git a/pages/windows/ri.md b/pages/windows/ri.md new file mode 100644 index 0000000000..aea54a8ebf --- /dev/null +++ b/pages/windows/ri.md @@ -0,0 +1,8 @@ +# ri + +> In PowerShell, this command is an alias of `Remove-Item`. +> More information: . + +- View documentation for the original command: + +`tldr remove-item` diff --git a/pages/windows/rm.md b/pages/windows/rm.md new file mode 100644 index 0000000000..b05d85d4e6 --- /dev/null +++ b/pages/windows/rm.md @@ -0,0 +1,8 @@ +# rm + +> In PowerShell, this command is an alias of `Remove-Item`. +> More information: . + +- View documentation for the original command: + +`tldr remove-item` diff --git a/pages/windows/rmdir.md b/pages/windows/rmdir.md index 3f231126d9..f20832e00e 100644 --- a/pages/windows/rmdir.md +++ b/pages/windows/rmdir.md @@ -1,8 +1,13 @@ # rmdir > Remove a directory and its contents. +> In PowerShell, this command is an alias of `Remove-Item`. This documentation is based on the Command Prompt (`cmd`) version of `rmdir`. > More information: . +- View the documentation of the equivalent PowerShell command: + +`tldr remove-item` + - Remove an empty directory: `rmdir {{path\to\directory}}` diff --git a/pages/windows/wget.md b/pages/windows/wget.md index 37b520470e..593525326f 100644 --- a/pages/windows/wget.md +++ b/pages/windows/wget.md @@ -1,6 +1,7 @@ # wget > In PowerShell, this command may be an alias of `Invoke-WebRequest` when the original `wget` program () is not properly installed. +> More information: . - Check whether `wget` is properly installed by printing its version number. If this command evaluates into an error, PowerShell may have substituted this command with `Invoke-WebRequest`: