Install F7History from the PowerShell Gallery.
Install-Module -Name "F7History"Add a line to import F7History in your PowerShell $profile:
Import-Module -Name "F7History"To change the key bindings, use the -ArgumentList parameter when importing the module. For example, to use F6 and Shift-F6 instead of F7 and Shift-F7:
Import-Module -Name "F7History" -ArgumentList @{Key = "F6"; AllKey = "Shift-F6"}At the PowerShell command line:
- Press
F7to see the history for the current PowerShell instance. - Press
Shift-F7to see the history for all PowerShell instances.
Whatever was typed on the command line before hitting F7 or Shift-F7 will be used for the Out-ConsoleGridView `-Filter`` parameter.
When the Command Line History window is displayed:
- Use the arrow keys or mouse to select an item.
- Use
ENTERto insert the selected item on the command line. - Use
ESCto close the window without inserting anything on the command line.