diff --git a/pages/windows/clear-history.md b/pages/windows/clear-history.md new file mode 100644 index 0000000000..9853e5ef6c --- /dev/null +++ b/pages/windows/clear-history.md @@ -0,0 +1,37 @@ +# Clear-History + +> A powershell command to clear the entries in the current session. +> Note: `clhy` can be used as an alias for `Clear-History`. +> More information: . + +- Clear all command history from current session: + +`Clear-History` + +- Clear command by specific name: + +`Clear-History -CommandLine "{{command}}"` + +- Clear multiple commands by name: + +`Clear-History -CommandLine "{{command_1}}", "{{command_2}}"` + +- Clear a specific history entry by ID: + +`Clear-History -Id {{id_number}}` + +- Clear multiple IDs: + +`Clear-History -Id {{id_1}}, {{id_2}}, {{id_3}}` + +- Clear commands within a range of IDs: + +`Clear-History -Id ({{start_id}}..{{end_id}})` + +- Show what would be deleted: + +`Clear-History -WhatIf` + +- Ask for confirmation before clearing: + +`Clear-History -Confirm` diff --git a/pages/windows/clhy.md b/pages/windows/clhy.md new file mode 100644 index 0000000000..cb547ad27d --- /dev/null +++ b/pages/windows/clhy.md @@ -0,0 +1,7 @@ +# clhy + +> This command is an alias of `Clear-History`. + +- View documentation for the original command: + +`tldr Clear-History`