Just wrote Powershell script that will look in Sub-Folder about the file which include ".doc_" in it's name that created 1 Min ago then to move it to another Sub-Folder.
When I ran the powershell script it will move that file which having ".doc_" in it's name that created 1 Min ago but also it will move same files which had ".doc_" in it's name that created days ago which is not required.
Could you please let me know why my code take in consideration files which is more than 1 Min
get-childitem -Path "C:\Users\Administrator\Desktop\Test\Test2" | where-object {$_.Name -match ".doc_" -and $_.LastWriteTime -lt (get-date).Adddays(-0) -and $_.LastWriteTime -lt (get-date).AddMinutes(-1)}| move-item -destination "C:\Users\Administrator\Desktop\Test"