L
L
lavrik_andrey2017-05-31 11:22:51
PowerShell
lavrik_andrey, 2017-05-31 11:22:51

How to find files that don't contain the string "something"?

There is a folder with a project, in which there are ~ 10k files and you need to find files with the extension .html and .htm, which do not contain the defined string "something"
There is such a solution in powershell, but it does not search in subdirectories

gci |foreach-object{if (-not (select-string -inputobject $_ -Pattern "something")){$_}}

you can't use scripts either.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
azarij, 2017-05-31
@lavrik_andrey

add -recurse to gci

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question