Skip to content

Instantly share code, notes, and snippets.

@martin9700
Last active October 12, 2015 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martin9700/dd61fedcdd56f63587c1 to your computer and use it in GitHub Desktop.
Save martin9700/dd61fedcdd56f63587c1 to your computer and use it in GitHub Desktop.
Switch ($true)
{
{$TotalCount}
{ ... }
{$Tail}
{
While ($Line = $File.ReadLine())
{
$RawData.Add($Line) | Out-Null
}
If ($Tail -gt $RawData.Count)
{
Write-Warning "Tail = $Tail is larger then file size, reading whole file"
$Tail = $RawData.Count
}
For ($i = ($RawData.Count - 1) - ($Tail - 1) ; $i -le $RawData.Count - 1 ; $i++)
{
Write-Output $RawData[$i]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment