touch all contents in a folder recursively

https://superuser.com/questions/598163/powershell-touch-all-files-newer-than

Powershell to use Unix touch seems silly to me.

Instead, just use native Powershell cmdlets.

This article covers it:

Essentially:

Get-ChildItem -Path $youFolder -Recurse | Foreach-Object {
    if ($_.LastWriteTime -ge [DateTime] "1/31/2013 9:00AM")
    { 
        $_.LastWriteTime = Get-Date
    }
}

Should do the trick.

posted @ 2018-09-20 18:35  ChuckLu  阅读(199)  评论(0编辑  收藏  举报