I´m searching for a string called "Please try again later" in a textfile.
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
------