From 11b71200314ed28f63749b535fbb60f7850fb984 Mon Sep 17 00:00:00 2001 From: Sri Sethu Madhavan S <124687386+sri-sethu@users.noreply.github.com> Date: Thu, 30 Oct 2025 17:43:25 +0530 Subject: [PATCH] clhy, Clear-History: add page (#19009) --- pages/windows/clear-history.md | 37 ++++++++++++++++++++++++++++++++++ pages/windows/clhy.md | 7 +++++++ 2 files changed, 44 insertions(+) create mode 100644 pages/windows/clear-history.md create mode 100644 pages/windows/clhy.md 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`