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

后端 未结 2 1938
醉梦人生
醉梦人生 2020-12-12 16:14

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:

2条回答
  •  我在风中等你
    2020-12-12 16:52

    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.

提交回复
热议问题