clhy, Clear-History: add page (#19009)

This commit is contained in:
Sri Sethu Madhavan S
2025-10-30 17:43:25 +05:30
committed by GitHub
parent 2749a5bce8
commit 11b7120031
2 changed files with 44 additions and 0 deletions
+37
View File
@@ -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: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/clear-history>.
- 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`
+7
View File
@@ -0,0 +1,7 @@
# clhy
> This command is an alias of `Clear-History`.
- View documentation for the original command:
`tldr Clear-History`