Add scripts for restoring files
This commit is contained in:
parent
b4dd114ba4
commit
c45a659aaa
2 changed files with 12 additions and 0 deletions
|
@ -55,5 +55,7 @@ function Invoke-WindowsRestore([Context] $context) {
|
|||
$context.Restore($backupPath, $context.BackupRoot());
|
||||
}
|
||||
|
||||
Invoke-FileRestore $context;
|
||||
|
||||
Remove-Item -Recurse $context.RootDir;
|
||||
}
|
||||
|
|
|
@ -16,3 +16,13 @@ function Invoke-FileBackup([Context] $context) {
|
|||
$context.Backup($candidate[1], $context.FileArchivePath($candidate[0]), $candidate[2]);
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-FileRestore([Context] $context) {
|
||||
foreach ($candidate in Get-BackupCandidates) {
|
||||
$archivePath = $context.FileArchivePath($candidate[0]);
|
||||
|
||||
if (Test-Path -PathType Leaf $archivePath) {
|
||||
$context.Restore($archivePath, $candidate[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue