Hi All,
I have just started using powershell and came across a problem:
I have to search for a particluar word/s in all the files of a folder and if a word is matched that file should be moved to a different folder.
I have tried this
get-ChildItem -include *.txt -recurse | select-String -pattern "Msg","Level"
and it gives me the correct output
test.sql.txt:1:Msg 156, Level 15, State 1, Server Line 2
test1.sql.txt:1:Msg 102, Level 15, State 1, Server Line 1
Now I want the above matched files moved to a different folder. How can I do this ?
Also, can I use Powershell to email those files to me ? I know this can be done, but need some help !
Thanks,
\\K
<message edited by sql_quest on Thursday, December 10, 2009 9:25 AM>