get-childItem -path m:\path\to\dir -attributes !directory -recurse | where-object {$_.lastWriteTime -gt (get-date).addDays(-4)} | select-object fullName
cmd.exe
, a similar thing is possible with forfiles.exe
. .jpg
extension to a file with a .jpeg
extension in the current directory: foreach ($file in gci *.jpg) { mv $file "$($file.basename).jpeg" }