Hi guys, this is a quick tip and useful.
Lets say that you have a file with 10 lines and you want to get only the last line :
Or if you want the last 3 lines :
If you want the first 2 lines :
Or you can use the totalcount parameter :
Or a specific line, lets say line 4 :
These examples ,excluding the totalcount parameter, are using an array to address the line, and in PowerShell the array is zero based, so to get the line 4 needs to refer to 3 ,or to get the first 2 lines needs to use 0 to 1