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

柔情痞子 提交于 2019-11-27 11:14:29

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/44104043/how-can-i-see-the-command-history-across-all-powershell-sessions-in-windows-serv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!