This one uses a file as the regex
Get-Content .\doc.txt | Select-String -Pattern (Get-Content .\regex.txt)
This one prints the line before as well
Get-Content .\doc.txt | Select-String -Pattern 'test' -context 1
Comments
Post a Comment