PowerShell查看历史记录

PowerShell的所有历史记录:

 
Get-Content (Get-PSReadLineOption).HistorySavePath
 
顺手写了一个掉用的函数: 
function Get-AllHistory
{
    $his = Get-Content (Get-PSReadLineOption).HistorySavePath
    $n = $his.Length
    $out = @()
    for($i=0;$i -lt $n;$i++)
    {
        $out = $out + "$i $($his[$i])"
    }
    return $out
}

 

 
posted @ 2020-03-18 13:27  酱_油  阅读(1700)  评论(0编辑  收藏  举报