Hi ThomasDBauer-9832,
The script you have provided looks as if it should work on the face of it. It's only looking back 7 years (365 * 7) so that isn't 2013, but 2015.
I would suggest a different script based on the following example:
do {
$date = Read-host "Enter date (MM/DD/YYYY) : "
} while ($date -as [datetime] -isnot [datetime])
$date = $date -as [datetime]
$date
New-Item -Path 'C:\temp\New Folder' -ItemType Directory
$path = "C:\temp\others\"
$destination = new-item c:\temp\others\$($date.toshortdatestring().replace("/","-")) -type directory
Foreach($file in (Get-ChildItem $path)) {
If($file.LastWriteTime -lt $date.date)
{
#Test to see if the file already exists in the destination. If not => Move/Copy/Action you want :D
if (!(Test-path (join-path $destination $file.name)))
{
Copy-Item -Path $file.fullname -Destination $destination
}
}
}
--If the reply is helpful, please Upvote and Accept as answer--