Search code examples
powershellwindows-server-2016

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


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

Solution

  • 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.