There are a number of ways to approach this.
Grabbing the first three lines of the text file:
(Get-Content File.txt)[0..2]
Selecting the string you wish to output:
((Get-Content File.txt -raw) | Select-String -pattern "(?s)some text.*?text 1").matches.value
Determining line numbers of bad lines and then excluding them:
$File = Get-Content File.txt
$FirstBadLine = $File.IndexOf("other text")
$LastBadLine = ($file | select -skip $firstbadline).IndexOf("text 1")+$firstbadline
$file[0..($firstbadline-1)],$file[($lastbadline+1)..$file.count]
Determine First Bad Line and skipping a known number of lines from there:
$File = Get-Content File.txt
$NumberOfBadLines = 5
$FirstBadLine = $File.IndexOf("other text")
$file[0..($firstbadline-1)+($firstbadline+$NumberOfBadLines)..$file.count] | Set-Content File.txt