powershell,

Show full history in PowerShell

Jul 15, 2022 · 1 min read · Post a comment

PowerShell’s Get-History only lists the current session history. Now, I’m going to share with you a quick nugget on how to show the full history from all sessions.

PowerShell and PS are used interchangeably.

Prerequisites

  • PowerShell

Solution

Step 1. Open PowerShell and run the following command:

cat (Get-PSReadlineOption).HistorySavePath

On Linux and macOS first thing you need to do is initialize a PS session before executing the previous command. For instance:

pwsh
cat (Get-PSReadlineOption).HistorySavePath

Note(s): (Get-PSReadlineOption).HistorySavePath will output the filepath.

Conclusion

Tried everything and nothing works? Let me know. On a side note, follow our official channel on Telegram.