首页/安全/取证与溯源速查/PowerShell 控制台历史
Windows 取证55 条

PowerShell 控制台历史

PSReadLine 把交互命令写入历史文件:能还原操作者在控制台敲过的命令序列,含时间辅助列。

取证与溯源速查安全更新于 2026-10-12
用途交互命令级复原
位置AppData/Roaming/Microsoft/Windows/PowerShell/PSReadLine/ConsoleHost_history.txt

读取

读取
Get-Content (Join-Path $env:APPDATA 'Microsoft/Windows/PowerShell/PSReadLine/ConsoleHost_history.txt') -Tail 60
与 4104 脚本块日志拼接:一个偏交互,一个偏执行。

易错点

  • 默认不记时间戳,需结合事件时间定位
  • 多用户各自一份历史,按账号目录分取

数据来源与参考

  • Microsoft Docs(about_PSReadLine)
​‌‌​​‌​​​‌‌​‌‌‌‌​‌‌​​​‌‌​‌‌‌​​‌‌​​‌​‌‌‌​​‌‌‌​​​‌​‌‌​‌​​‌​‌‌‌​​​‌​‌‌​‌​​‌​‌‌​​​‌‌​‌‌‌​‌​​​‌‌​‌‌‌‌​​‌​‌‌‌​​‌‌​​​‌‌​‌‌​‌‌‌‌​‌‌​‌‌​‌