Skip to content

Commit fe10433

Browse files
committed
Set-PSReadlineKeyHandler -Key F7 - two minor tweaks
- Clearer output of the result $line. - $ -> @, just in case if there is the only history command.
1 parent 771ff17 commit fe10433

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PSReadLine/SamplePSReadlineProfile.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Set-PSReadlineKeyHandler -Key F7 `
3333
$pattern = [regex]::Escape($pattern)
3434
}
3535

36-
$history = [System.Collections.ArrayList]$(
36+
$history = [System.Collections.ArrayList]@(
3737
$last = ''
3838
$lines = ''
3939
foreach ($line in [System.IO.File]::ReadLines((Get-PSReadlineOption).HistorySavePath))
@@ -60,7 +60,8 @@ Set-PSReadlineKeyHandler -Key F7 `
6060

6161
if (($line -cne $last) -and (!$pattern -or ($line -match $pattern)))
6262
{
63-
($last = $line)
63+
$last = $line
64+
$line
6465
}
6566
}
6667
)

0 commit comments

Comments
 (0)