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
}
 

猜你喜欢

转载自www.cnblogs.com/JiangOil/p/12516881.html