Have a script which search a given network location for specific file based on a given word. I need to adapt this and get the script to copy the file to another given network location.
Can someone help?
"`n"
write-Host "Search Running" -ForegroundColor Red
$filePath = "\\fileserver\mylocation$\folder"
"`n"
Get-ChildItem -Recurse -Force $filePath -ErrorAction SilentlyContinue | Where-Object { ($_.PSIsContainer -eq $false) -and ( $_.Name -like "*keyword*"
) } | Select-Object Name,Directory,CreationTime,LastAccessTime,LastWriteTime | Export-Csv "C:\scripts\searches\csv\27022014.csv" -notype