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

其他-如何查看 Windows Server 2016 中所有 PowerShell 会话的命令历史记录?

(其他 - How can I see the command history across all PowerShell sessions in Windows Server 2016?)

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

在哪里可以查看 Windows Server 2016 中所有会话的完整历史记录?

以下 PowerShell 命令仅包含当前会话中的命令:

Get-History
Questioner
Daniel Leach
Viewed
0
28.3k 2018-12-18 15:03:44

在 PowerShell 中输入以下命令:

(Get-PSReadlineOption).HistorySavePath

这为你提供了保存所有历史记录的路径。然后在文本编辑器中打开路径。

尝试cat (Get-PSReadlineOption).HistorySavePath在 PowerShell 中列出历史记录。