i awm having some windows backup folder and want to put it on some samba share folder to create a backups, problem is that in windows it creates every day backups, and i want only the latest. Files are named like: Backkup1.zip, Backkup2.zip, etc.
$backuppath = "D:test" get-childitem -path $backuppathget-childitem -path $backuppath -Filter “Backkup*.zip” |
where-object { -not $_.PSIsContainer } |
sort-object -Property $_.CreationTime |
select-object -last 1 | pscp -pw mypass -r $Path user@192.168.12.20:/mnt/DatabaseBackup