Skip to content

Commit

Permalink
Update Microsoft.PowerShell_profile.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasholla committed Jun 17, 2024
1 parent a4f28c9 commit c82e8a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Microsoft.PowerShell_profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Set-PSReadLineKeyHandler -Key 'Alt+e' -BriefDescription "CWD" -LongDescription
# Function to clear duplicate entries in the history file
function Remove-DuplicateHistoryEntries {
try {
$historyPath = [System.IO.Path]::Combine($env:APPDATA, 'Microsoft', 'Windows', 'PowerShell', 'PSReadLine', 'ConsoleHost_history.txt')
$historyPath = (Get-PSReadlineOption).HistorySavePath
if (Test-Path $historyPath) {
$uniqueHistory = Get-Content $historyPath | Select-Object -Unique
$uniqueHistory | Set-Content $historyPath
Expand Down

0 comments on commit c82e8a9

Please sign in to comment.