


Replace “Example” in the cmdlet below with the text you want to search for: Get-History | Select-String -Pattern "Example" You can search your history by piping the resulting output to the Select-String cmdlet and specifying the text you want to search for. To view the history of commands you’ve typed, run the following cmdlet: Get-History You can use several included cmdlets to view and work with your history. Windows PowerShell itself keeps a history of the commands you’ve typed in the current PowerShell session. To change this, right-click the title bar of the PowerShell prompt window, select “Properties”, and change the value of “Buffer Size” under Command History. So, if you wanted to search for a command that began with “p”, you’d type “p” on the command line and then repeatedly tap F8 to cycle through commands in your history that begin with “a”.īy default, the buffer remembers the last 50 commands you typed. F8: Search your command history for a command matching the text on the current command line.Press the key repeatedly to walk through your command history. Down Arrow: Recall the next command you typed.Up Arrow: Recall the previous command you typed. Press the key repeatedly to walk through your command history.First, there’s the commandline buffer, which is actually part of the graphical PowerShell terminal application and not part of the underlying Windows PowerShell application.

PowerShell technically has two types of command history. RELATED: Geek School: Learn How to Automate Windows with PowerShell
