I need a powershell script to move files from one target location to another target location based on the date I specified. The script also needs to override any existing files in the destination location if they exist.
This is what I had so far but its based on how many days from today:
Powershell
$path="C:\temp\others\"$destination=new-itemc:\temp\others\$($date.toshortdatestring().replace("/","-"))-typedirectoryForeach($filein(Get-ChildItem$path)){If($file.LastWriteTime-gt(Get-Date).adddays(-1).date){Move-Item-Path$file.fullname-Destination$destination}}