Hello Fellow Powershellers
I’ve been tasked with decommissioning a server. This server has text files, CSV, XLS all over the C:\ drive. I need to copy all of those files to a USB attached disk. This is what I’ve come up with:
$Source = “C:”
$Target = “F:\Import”
$Include = ‘.txt’,’.csv’,’.xls’,’.xlsx’
Copy-Item -Path $Source -Destination $target -Force -Include $Include -Recurse
The folder F:\Import does exist. Hopefully it’s something obvious I’m missing.
Kind regards, Darren