I have a list of files that contain either of the two strings:
"stuff
" or ";stuff
"
I'm trying to write a PowerShell Script that will return only the files that contain "stuff
". The script below currently returns all the files because obviously "stuff
" is a substring of ";stuff
"
For the life of me, I cannot figure out how to only matches file that contain "stuff
", without a preceding ;
Get-Content "C:\temp\list\list.txt" |
Where-Object { Select-String -Quiet -Pattern "stuff" -SimpleMatch $_ }
Note: C:\temp\list\list.txt
contains a list of file paths that are each passed to Select-String
.
Thanks for the help.