I’m hoping someone could assist me with part of a script. I need to make a slight amendment but I’m not sure how to.
Here is the part I need to change…
$CopyDir = “C:\logs”
$a = Get-ChildItem $CopyDir
foreach($x in $a)
$y = ((Get-Date) - $x.CreationTime).Days
if ($y -gt 90 -and $x.PsISContainer -ne $True)
What I would like to do is not delete the files older than 90 day, but move them to another folder. I understand what the script is doing but I’m not sure how to go about changing it from deleting the files to moving them, could someone help me understand? I’ll be looking for more information but thought I would post here first as you’ve been so helpful in the past.