Hi, I have a script that saves all files that need to be copied to another directory into a CSV file. The CSV file has a list of all filenames in it, and I feed the names as a variable into Copy-Item -
$output | select-object FileName | Export-Csv -Path C:\Changes.csv -NoTypeInformation $NewVersions = import-csv -Path "C:\changes.csv" forEach ($row in $NewVersions) { $filename = $row.FileName Copy-Item "C:\SOURCE\$filename" "C:\DESTINATION" write-host "Copying - " $filename }
I've noticed, the script doesn't copy the file attributes along with it, for example, date created, date modified etc. Is there any way that I can modify the script so that it copies the file and its attributes?
Thanks.
- Edited by rundownbassman92 18 hours 29 minutes ago