How to select files by date and copy them?
can me translate cygwin bash powershell?
/usr/bin/find . -type f -newerct '2 day ago' ! -newerct '1 days ago' -exec cp {} e\:/ \;
this script finds files in current directory older 1 day , younger 2 days old copies them e drive. how do in powershell?
thanks!
siegfried
siegfried heintze
$min = (get-date).adddays(-1) $max = (get-date).adddays(-2) get-childitem | ? {$_.lastaccesstime -le $min -and $_.lastaccesstime -ge $max }
get-childitem | ? {$_.lastaccesstime -le $min -and $_.lastaccesstime -ge $max } | % {copy-item $_.fullname e:\ }
life short, enjoy cyreli
Windows Server > Windows PowerShell
Comments
Post a Comment