I have a text file as follows
Apple=1
Manggo=1
Appleandmanggobellongsto=Jimmy
Apple=1
Manggo=1
Appleandmanggobellongsto=Dave
Apple=1
Manggo=1
Appleandmanggobellongsto=Carlton
I want to remove the last 3 lines and this is what I want to achieve:
Apple=1
Manggo=1
Appleandmanggobellongsto=Jimmy
Apple=1
Manggo=1
Appleandmanggobellongsto=Dave
$File = c:\Text.txt
get-content $File | select-object -skiplast 3 | set-contect $File
but I dont get anything.
please tell me what I did wrong?