At First: Please excuse for my bad english
I´m Searching for a String called "Please try again later" in a Textfile. Can someone tell me, how i can export the line with the match including n lines before the matching line?
Currently i use the following command to extract the matching line.
get-content "File.txt | select-string "Later"
Output should be like this (including ------------ if possible)
------
Sending: 250 <[email protected]>
SMTP Command: R-CPT TO:<[email protected]>
Sending: 451 Please try again later
------
Thanks! Daniel