I have a PowerShell script:
(Select-String -path c:\*.txt -Pattern 'searchstring').Line | set-content d:\output.txt
It works fine but the output file is too big. What I would like is for it to output multiple files so output.txt is the same number of files as is being read in with the wild card.
So:
c:\1.txt
c:\2.txt
c:\3.txt
Would output the matched lines to:
d:\1.txt
d:\2.txt
d:\3.txt