Commands in Windows PowerShell can get extremely repetitive — you get bored and impatient of retyping things really quick. Fortunately, there are ways to speed up the process, allowing you to reuse commands you’ve typed before.

Reusing a command

In PowerShell, reusing commands are quite neat. All you have to do is press F7. This brings up your recent history of commands. You can run through the list with the arrow keys and select which one you’d like to reuse by simple pressing Enter. As an alternative, you can press the right arrow button to simply enter in on the command line without running it. Once you do want to run it, you’d (obviously) press the Enter button. Or, you can do other things with it, like copy it to your clipboard and so on.

Alternatively, you can run through your command history forwards or backwards by pressing the up or down arrows, too.

As an added note, you can actually press F5 to scan backwards through your command history.

If you want to delete your command history, that’s quite easy, too. Instead of pressing F7 to open the command history, you would press Alt + F7 at the same time to clear it.

Closing

This is certainly one of the more simple tricks of PowerShell, but it’s also one of the most useful tricks. If you’re really getting into PowerShell and finding yourself using the same commands over and over again, using the above steps can actually be a shortcut.