Fix backup path inquiry
This commit is contained in:
parent
6a57e2cbaf
commit
a99314afa8
1 changed files with 5 additions and 1 deletions
|
@ -34,11 +34,15 @@ function Invoke-WindowsRestore([Context] $context) {
|
|||
{
|
||||
$backupPath = Read-Host -Prompt "Please enter the path to the archive load the backup from.";
|
||||
|
||||
if ((-not $backupPath) -or (-not (Test-Path -PathType Leaf $backupPath)))
|
||||
if ($backupPath -and (-not (Test-Path -PathType Leaf $backupPath)))
|
||||
{
|
||||
Write-Host "No file could be found at the specified path.";
|
||||
return Read-Path;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $backupPath;
|
||||
}
|
||||
}
|
||||
|
||||
$backupPath = Read-Path;
|
||||
|
|
Loading…
Reference in a new issue