Let say that there is an old Windows IIS web server that has some type of code that sends SMTP email. How can you search through all the files without opening them all?
Yes; there is a GREP package that can be installed.
But if you wanted native Powershell or if you're in a locked down environment where the security team would throw a fit then:
cd \\remote-system\e$\inetpub\wwwroot
Get-ChildItem -Path .\ -Filter "*.cfm" -Recurse | Select-String -Pattern "mail.domain.tld"