|
Re: Searching for content in text files with powershell Use Select-String's -Quiet switch --it returns a boolean value-- and filter the files that match with Where-Object to set their content to the new file:
set-content E:\test.txt (
get-childItem *.txt |
where {select-string $term $_ -quiet} |
get-content
)
--
Kiron |