HP Matrix 7.2 KVM Private Cloud Backup and Restore

Table Of Contents
$exitquery = 0
}
} while ($exitquery -eq 0)
}
else
{
Write-Host "improper filepath or no permission to write to given directory"
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message
"Improper filepath, $storagepath " $_.Exception.message
return
}
}
$savedLoginJson = Get-Content $storagepath
Write-Host "run backup?"
$continue = 0
do
{
$earlyExit = Read-Host
if ($earlyExit[0] -eq 'n')
{
return
}
elseif ($earlyExit[0] -ne 'y')
{
Write-Host "please respond with a y or n"
}
else
{
$continue = 1
}
} while ($continue -eq 0)
}
else
{
return $loginJson
}
}
elseif ($args.count -ne 1)
{
Write-Host "Incorrect number of arguments, use either filepath parameter or no parameters."
return
}
else
{
foreach ($arg in $args)
{
$storagepath = $arg
}
try
{
$savedLoginJson = Get-Content $storagepath -ErrorAction stop
}
catch [System.Exception]
{
Write-Host "Login credential file not found. Please run script without arguments to
access manual entry mode."
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Login
credential file not found. Please run script without arguments to access manual entry mode."
return
}
}
return $savedloginJson
}
##### Sending login info #####
function login-appliance ([string]$username,[string]$password,[string]$hostname)
{
<#
.DESCRIPTION
39