Forum Discussion

niazstinu's avatar
niazstinu
Brass Contributor
Feb 08, 2021
Solved

How to Read Certain line in Powershell

How can I read line number 10  from a text file ?1
  • farismalaeb's avatar
    Feb 08, 2021

    niazstinu 

    There are multiple way

    The easiest is Load the file and select the line you need as its an array

    $x=Get-content C:\MyFile.txt

    $x[9]

    Or you can use this way

    $x | select -First 1 -Skip 9

Resources