How can I see the command history across all PowerShell sessions in Windows Server 2016?

Daniel Leach picture Daniel Leach · May 22, 2017 · Viewed 35.3k times · Source

Where can you view the full history from all sessions in Windows Server 2016?

The following PowerShell command only includes the commands from the current session:

Get-History

Answer

Daniel Leach picture Daniel Leach · May 22, 2017

In PowerShell enter the following command:

(Get-PSReadlineOption).HistorySavePath

This gives you the path where all of the history is saved. Then open the path in a text editor.

Try cat (Get-PSReadlineOption).HistorySavePath to list the history in PowerShell.