Show info if backup archive does not exist
This commit is contained in:
parent
9aa9ad4558
commit
9ffa903626
1 changed files with 17 additions and 7 deletions
|
@ -104,15 +104,25 @@ class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
[void] Restore([string]$archivePath, [string]$destinationPath) {
|
[void] Restore([string]$archivePath, [string]$destinationPath) {
|
||||||
if (-not (Test-Path -PathType Container $destinationPath)) {
|
if (-not (Test-Path -PathType Leaf $archivePath)) {
|
||||||
New-Item -ItemType Directory "$destinationPath";
|
Write-Information (
|
||||||
|
[string]::Join(
|
||||||
|
"`n",
|
||||||
|
@(
|
||||||
|
"An archive at the specified path $archivePath does not exist.",
|
||||||
|
"No restoration will be performed.")));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (-not (Test-Path -PathType Container $destinationPath)) {
|
||||||
|
New-Item -ItemType Directory "$destinationPath";
|
||||||
|
}
|
||||||
|
|
||||||
Start-Process -WorkingDirectory "$destinationPath" `
|
Start-Process -WorkingDirectory "$destinationPath" `
|
||||||
-FilePath "7z"
|
-FilePath "7z"
|
||||||
-ArgumentList "x" `
|
-ArgumentList "x" `
|
||||||
-Wait `
|
-Wait `
|
||||||
-NoNewWindow;
|
-NoNewWindow;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[string] GetTempDirectory() {
|
[string] GetTempDirectory() {
|
||||||
|
|
Loading…
Reference in a new issue