back up and delete the original source

here is the script I used to back up the files. I can backup the files and delete the files. but I want to back up the files before today's date and delete the files before today's date. so can you please help me with that? can you help me to add date attributes in file?

thanks in advance.

$erroractionpreference ="stop"

$thefolder ="E:\kplc1"

$thefolder1 ="E:\kplc2"

$stagin ="C:\stagin"

$back ="F:\KPLC1"

$back1="F:\KPLC2"

Remove-Item $back\* -Recurse -Force

Remove-Item $back1\* -Recurse -Force

Copy-Item -Path $thefolder\* -Destination $stagin -Recurse -Force

Copy-Item -Path $thefolder1\* -Destination $stagin -Recurse -Force

Copy-Item -Path $stagin\* -Destination $back -Recurse -Force

Copy-Item -Path $stagin\* -Destination $back1 -Recurse -Force

Remove-Item $stagin\* -Recurse -Force

Remove-Item $thefolder\* -Recurse -Force

Remove-Item $thefolder1\* -Recurse -Force

Parents
No Data
Reply Children
No Data