$files = dir *.log | ?{$_.LastWriteTime -gt (Get-date).addhours(-4)}
foreach($file in $files)
{
$FileName = $file.name -replace $file.Extension,""
$NewName = "${FileName}$(Get-date -f "MM-dd-yy-HH-mm").log"
rename-item -path $file.fullname -newname $NewName -whatif
Move-Item $NewName -dest -whatif
}
|