Powershell script to list all files older than 1 day

2/03/2014 0 Comments


$myPath = "C:\Users"
Get-ChildItem -Path $Path -Recurse | Where-Object{$_.PSIsContainer -eq $true} | ForEach-Object{$curPath = $_.FullName  If((Get-ChildItem -Path $curPath | Where-Object $_.LastWriteTime -gt (get-Date).AddDays(-1)}).count -gt 0) {
        Write-Host $curPath
    }
}
#Powershell

0 comments :