Warm tip: This article is reproduced from serverfault.com, please click

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

发布于 2017-05-22 03:05:27

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
Questioner
Daniel Leach
Viewed
0
28.3k 2018-12-18 15:03:44

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.