I am trying to write a powershell script which will return the contents inside a txt file. However, I do not want to specify the drive of the txt file as the txt file will be placed in the same folder as the powershell script.
I am using this line of code:
get-content .\document.txt | select -first 1 -skip 1
but it doesnt work.
Inside document.txt:
- This is the first line
- This is the second line
What script do I write to retrieve the second line "This is the second line" without having to put the full path like "C:\Data\Scripts\Document.txt"? I have searched online solution but many solutions required me having to put its destination path.