$source = '<path>' $destination = '<path>' @(Get-ChildItem $source -Filter *.bak | Sort LastWriteTime-Descending)[0] | % { Copy-Item -path $_.FullName -destination $("$destination\CMSOPEN_backup.bak") -force }
$source = '<path>' $destination = '<path>' @(Get-ChildItem $source -Filter *.bak | Sort LastWriteTime-Descending)[0] | % { Copy-Item -path $_.FullName -destination $("$destination\CMSOPEN_backup.bak") -force }
2 Comments
Awesome!
ReplyDeleteThanks.
Perfect
ReplyDelete