Add scripts for restoring files
This commit is contained in:
parent
b4dd114ba4
commit
c45a659aaa
2 changed files with 12 additions and 0 deletions
scripts/Windows/Scripts
|
@ -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…
Add table
Add a link
Reference in a new issue