$result = Get-Content -Path D:\out.txt
$grepString = $result | Select-String -Pattern "startpoint of the string"
Write-Host $grepString
I used this code but it is printing only one line(when it get \n), But I want my output in containing rest of the lines
"startpoint of the string", all the way to the end? Is that including"startpoint of the string"?Out.txtfile to your Question.