Created
September 25, 2018 14:13
-
-
Save Kaapiii/a68a9a75e82dd0dcacea54217c8c2e67 to your computer and use it in GitHub Desktop.
Backup files by filter from source directory and copy them to a new folder prfixed with the current date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$backupSourcePath = 'C:\Test\Source' | |
$backupDestPath = 'C:\Test\Dest' | |
$currentBackupDir = New-Item -ItemType Directory -Path "$backupDestPath\$((Get-Date).ToString('yyyy-MM-dd'))" | |
Get-ChildItem -Path "$backupSourcePath\*" -Include *.txt,*.db,*.log -Recurse | Copy-Item -Destination $currentBackupDir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment