I have a script that will search for strings or a list of strings and create a report. What I'm having trouble with is, I now need to know what strings were NOT found as well as those that were. Would anyone be able to offer an alteration to the script below to achieve this?
Thanks, -Ron
$searchWords=Get-Content "C:\Directory containing file\Text_To_Search_For.txt"
# List the starting(parrent) Directory here - the script will search thropugh every file and every sub-directory - starting fromn the one listed below
Get-Childitem -Path "C:\Start my search here\" -Recurse |
Select-String -Pattern $searchWords |
# the output will contain the [Found] word, the document it found it in and the line contents/line number containing the found string
Select Filename,Line,@{n='SearchWord';e={$_.Pattern}}, LineNumber