I\'m looking for the PowerShell equivalent to grep --file=filename. If you don\'t know grep, filename is a text file where each line has a regular
grep --file=filename
grep
The -Pattern parameter in Select-String supports an array of patterns. So the one you're looking for is:
-Pattern
Select-String
Get-Content .\doc.txt | Select-String -Pattern (Get-Content .\regex.txt)
This searches through the textfile doc.txt by using every regex(one per line) in regex.txt
doc.txt
regex.txt