gpt4 book ai didi

Powershell PSReadLine 历史

转载 作者:行者123 更新时间:2023-12-02 23:53:07 31 4
gpt4 key购买 nike

我很困惑PSReadLine历史在 Powershell 中跨 session 工作。我可以在 PS 版本 5.1 中看到我以前的命令历史记录自动存储在

%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\

但是,如果我运行 get-history我只看到我当前的 session 命令历史记录。我认为在更高版本的 Powershell 中不再需要跨 session 保存命令历史记录的 Hook 。我错过了什么?

最佳答案

文件

%userprofile%\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt

仅包含输入的命令(此处为 ATM 22k 行),

和当前 session 历史
Get-History | Format-List -Property *
Id                 : 88
CommandLine : get-help Get-History -online
ExecutionStatus : Completed
StartExecutionTime : 2018-12-14 16:16:49
EndExecutionTime : 2018-12-14 16:16:49

是完全不同的东西。

关于Powershell PSReadLine 历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53782159/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com