Skip to content

Instantly share code, notes, and snippets.

@agross
Created October 1, 2009 21:34
Show Gist options
  • Save agross/199255 to your computer and use it in GitHub Desktop.
Save agross/199255 to your computer and use it in GitHub Desktop.
Get-ChildItem -recurse `
| Where-Object { $_.PsIsContainer } `
| ForEach-Object { Get-ChildItem -path $_.FullName | Sort-Object -property LastWriteTime | Select-Object -last 1 } `
| Foreach-Object { Write-Host $_.Directory; [System.IO.Directory]::SetLastWriteTime($_.Directory, $_.LastWriteTime) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment