Advertisement
littlebelialskey

getLastLogsOnly.ps1

Aug 8th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.88 KB | Source Code | 0 0
  1. <# -------- GO getLastLogsOnly for Shtivi's  RDR2 mods  -------- #>
  2.  
  3. $content = (get-content "Log.log")
  4. $totalNbLignes = $index = $content.Count
  5. $latestLogLinesLength = 0
  6. $outputFilename = "TODAYS-DATE-MAYBEhueheh_lastLogsOnly.log"
  7.  
  8. while($index--){
  9.     if($content[$index] -match "^.*Shtivi.*$"){
  10.         break
  11.     }
  12. }
  13.  
  14. $latestLogLinesLength = $totalNbLignes - $index
  15.  
  16. Get-content -tail $latestLogLinesLength .\Log.log > $outputFilename
  17. Start notepad++ $outputFilename
  18.  
  19. <# -------- END -------- #>
  20.  
  21. <# meeeeh #>
  22. <# $verbose=false #>
  23. <# if($verbose) { Write-Host -fore Cyan "index = $index" -nonewline } #>
  24. <#  if($verbose){ Write-Host [$index] -Nonewline } #>
  25. <#      if($verbose){ Write-Host -foregroundColor Yellow "[$index]" } #>
  26. <#      if($verbose) { Write-Host "wewewew" -Nonewline } #>
  27. <# Write-Host -fore red "Le dernier log commence ligne [$index] et s arrete a [$totalNbLignes]" #>
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement