Here's how I would do it:
#Folder to search
$folder = "D:\trond.hindenes\Desktop\test"
#File to store log file copies in
$destinationfolder = "D:\trond.hindenes\Desktop\test2"
#Search for:
$SearchTerm = "BAT"
#Files to include in search
$FileFilter = "file*"
#Get the files according to filter. Recurse, but exclude directories
$files = Get-ChildItem -Path $folder -Include $filefilter -recurse | where {$_.PSIsContainer -eq $false}
foreach ($file in $files)
{
$result = $file | Select-String $SearchTerm
#If we get a hit, copy the file
if ($result)
{
Write-host "Found match in file $($file.Name) ($($file.Directory))"
#Add result to file
$file | Copy-Item -Destination $destinationfolder
#Also output it
$result
}
}