There was an error while loading. Please reload this page.
1 parent d8b59a9 commit d36fbb4Copy full SHA for d36fbb4
Modules/Scripts/Get-HistoryEx.ps1
@@ -23,6 +23,14 @@ Begin
23
{
24
$script:id = 1
25
26
+function MeasureHistory
27
+{
28
+# counts all lines so we can adjust the offset when only tailing
29
+$count = (Get-Content $savePath | Measure-Object).Count
30
+write-host "lines=$count"
31
+$script:id = $count - $last + 1
32
+}
33
+
34
function GetHistory
35
36
if ($last -gt 0 -and $match -ne $null)
@@ -53,7 +61,7 @@ Begin
53
61
}
54
62
Process
55
63
56
-$script:last = 0
64
+$script:last = 40
57
65
$script:match = $null
58
66
59
67
# because I'm too lazy to remember param names...
@@ -74,5 +82,6 @@ Process
74
82
75
83
$script:savePath = (Get-PSReadlineOption).HistorySavePath
76
84
85
+MeasureHistory
77
86
GetHistory
78
87
0 commit comments