Shows how to search files based on extension in your drive, also shows how to search content of a txt file and replace it.
Search for 7z file extention in C drive
Get-ChildItem -Path c:\ -Include *.7z -File -Recurse -ErrorAction SilentlyContinue
Search for txt file in C drive
Get-ChildItem -Path c:\ -Include *.txt -File -Recurse -ErrorAction SilentlyContinue
Search multiple folders for 7z & txt extention files
Get-ChildItem -Path c:\NewFolder, C:\NewFolders -Include *.txt, *.7z -File -Recurse -ErrorAction SilentlyContinue
Search the content of a text file
Get-Content -Path 'C:\NewFolder\New Text Document.txt'
Replace the content of a text file
(Get-Content -Path 'C:\NewFolder\New Text Document.txt' -Raw) -replace 'This is a', 'My Test'
Replace the content of a text file and save it
(Get-Content -Path 'C:\NewFolder\New Text Document.txt' -Raw) -replace 'This is a', 'My Test' | Set-Content -Path 'C:\NewFolder\New Text Document.txt'