Allow addition of custom restoration arguments

This commit is contained in:
Manuel Thalmann 2024-03-24 18:08:54 +01:00
parent c781134141
commit 17a18866f5

View file

@ -178,6 +178,10 @@ class Context {
} }
[void] Restore([string]$archivePath, [string]$destinationPath) { [void] Restore([string]$archivePath, [string]$destinationPath) {
$this.Restore($archivePath, $destinationPath, @());
}
[void] Restore([string]$archivePath, [string]$destinationPath, [string[]] $arguments) {
if (-not (Test-Path -PathType Leaf $archivePath)) { if (-not (Test-Path -PathType Leaf $archivePath)) {
$archivePath = "$archivePath.001"; $archivePath = "$archivePath.001";
} }
@ -197,7 +201,7 @@ class Context {
Start-Process -WorkingDirectory "$destinationPath" ` Start-Process -WorkingDirectory "$destinationPath" `
-FilePath "7z" ` -FilePath "7z" `
-ArgumentList @("x", "$archivePath") ` -ArgumentList @("x", "$archivePath") + $arguments `
-Wait ` -Wait `
-NoNewWindow; -NoNewWindow;
} }