gfody/PowershellModules

Search-files -file filter issue

Technical87 opened this issue · 2 comments

Hello,

I'm running the following code from a Windows 10 workstation with Microsoft Office 2016 installed: $SearchResults = foreach ($Word in (Get-Content "c:\users\<snipped>\desktop\powershell test\words.txt")) {search-files -pat $Word -file *.docx -path "Y:\<snipped path>" }

However it only seems to want to search .doc files and not .docx files or pdf. Am i doing something wrong here?

gfody commented

.docx and .pdf are binary files and will be skipped by Search-Files. You'll need to use Search-Index (and these files will need to be in the index).

Thanks, I've now updated my script to use search-index. Closing this issue :)