I have 10k of html files and about 3k of them include youtube video embed code, so i search for the string to get list of those files like this:
$LocalListOfYTPosts = Get-ChildItem "$outputfolder*.html" -recurse |
Select-String -pattern "https://www.youtube.com/embed" |
group path |
select name -ExpandProperty Name
Youtube embed code is included only once per file, so i thought that i could speed things up if search will go to next file after 1st occurrence of the string (I'm not sure if that's actually correct)
Is there a way to tell to powershell to go to next file if the string has been found in in the current one?