This sample defines a PowerShell function that lists files in a directory that haven't been modified for x number of days. The function takes a parameter which specifies the number of days:
Function Get-FilesXDaysOld([string]$path,[int]$daysOld) {
Get-ChildItem -Path $path | ?{$_.LastWriteTime.Date -le (Get-Date).AddDays(-$daysOld)}
}
C:\Windows\system32> Get-FilesXDaysOld "C:\Files\" 10
C:\Windows\system32> Get-FilesXDaysOld "C:\Files\" 5