Get-ChildItem -rec -exclude "*No-Number*" | % { $objItem = $_ Write-Host ('********' + $objItem.fullname ) If ($objItem -is [System.IO.FileInfo] -and ((get-date) - [datetime]::Parseexact($objItem.name.split('-')[1],"yyyyMMdd",$null)).days -gt 360) { $oldpath = $objItem.FullName.SubString($pwd.path.length) $newpath = ('f:\old_calls\' + $oldpath) $olddir = ($objItem.directory -replace 'e:', 'f:\old_calls') if ([System.IO.Directory]::Exists($olddir) -eq $false) { New-Item $olddir -type directory } Move-Item -path $objItem.fullname -destination $newpath } Else { Write-host ('<<<<<>>>>>> the path above this line doesnt meet IF requirements') } }