Powershell script to list all files older than 1 day
#Powershell
$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
}
}
0 comments :