See the Full PowerShell Command History (PSReadLine)

Get-History only shows the current session. PSReadLine saves every command in a text file:

%APPDATA%\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

Open it or search it directly:

notepad (Get-PSReadLineOption).HistorySavePath
Get-Content (Get-PSReadLineOption).HistorySavePath | Select-String "docker"

Tip: press Ctrl + R in the console for reverse search.

Careful: anything typed on the command line, including passwords, can end up in this file.

More info.

Written by Daniel Ruiz Peláez, Systems & Infrastructure Engineer (Linux, VMware, Proxmox, Active Directory, networking and security). These are notes from real problems I have solved.

← Back to all posts