Files
tldr/pages.zh/windows/get-history.md

415 B

获取历史记录

显示 PowerShell 命令历史记录。 注意:此命令只能通过 PowerShell 使用。 更多信息:https://learn.microsoft.com/powershell/module/microsoft.powershell.core/get-history

  • 显示带有 ID 的命令历史列表:

Get-History

  • 通过 ID 获取 PowerShell 历史项:

Get-History -Id {{id}}

  • 显示最近的 N 条命令:

Get-History -Count {{10}}