Category Archives: Powershell

PowerShell- Retrieve today’s Files

Below function recurses through the path provided as parameter and lists out the files whose LastWriteTime has today’s date.

function Get-TodaysFiles{
param(
[string]$Path
)
$date=get-date
Get-ChildItem -Path $Path -Recurse | Where {!$_.PSIsContainer -and $_.LastWriteTime.Date -eq $date.Date } |select Name,LastWriteTime, Directory
}