[PowerShell] Clear History of Previous Commands

Jen Y·2021년 8월 18일
0

Clear History in PowerShell

Get the PowerShell command history file location:

PS C:> (Get-PSReadlineOption).HistorySavePath

Show the contents of the PowerShell command history file:

PS C:> cat (Get-PSReadlineOption).HistorySavePath

Clear the command history in PowerShell by deleting the history file:

PS C:> Remove-Item (Get-PSReadlineOption).HistorySavePath

Change how PowerShell command history is saved:

PS C:> Set-PSReadlineOption -HistorySaveStyle SaveIncrementally # default
PS C:> Set-PSReadlineOption -HistorySaveStyle SaveAtExit
PS C:> Set-PSReadlineOption -HistorySaveStyle SaveNothing

https://www.shellhacks.com/clear-history-powershell/

0개의 댓글