Last active
November 22, 2021 17:11
-
-
Save KirillPashkov/03f0ac0b0ccbdaa3f83ac4291264fb22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$lookup = '***' | |
Out-File -FilePath C:\temp\results.txt -InputObject $lookup -Encoding utf8 -Force -Append | |
gci -File 'C:\temp\1' -Recurse -Filter '*.*' -Exclude '*.zip'| | |
select -exp FullName | % { | |
$f = gc $_; $l=1 | |
foreach($r in @($f.Split("`n"))){ | |
#if ($r.Length -gt 0 -and $r -match $lookup){Write-Host $("File: {0}`tLine: {1}`tString: {2}" -f $_,$l,$r) -b Black -f Green}; $l++ | |
if ($r.Length -gt 0 -and $r -match $lookup){Out-File -FilePath C:\temp\results.txt -InputObject $("[File: {0}][Line: {1}][String: {2}]" -f $_,$l,$r) -Encoding utf8 -Force -Append }; $l++ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment