Hp OneView Manual do Utilizador Página 286

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 307
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 285
$downloadUri
try
{
$testCurlSslOption = curl -V
if ($testCurlSslOption -match "SSL")
{
invoke-expression $curlDownloadCommand
}
else
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Version of curl must support SSL to get improved download performance."
}
else
{
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Version of curl must
support SSL to get improved download performance"
}
return download-Backup-without-curl $backupResource $authValue $hostname
}
if ($LASTEXITCODE -ne 0)
{
$errorResponse = invoke-expression $curlGetDownloadErrorCommand
if ($global:interactiveMode -eq 1)
{
Write-Host "Download using curl error: $errorResponse"
}
else
{
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Download error:
$errorResponse"
}
if (Test-Path $filePath)
{
Remove-Item $filePath
}
return
}
if ($global:interactiveMode -eq 1)
{
Write-Host "Backup download complete!"
}
}
catch [System.Management.Automation.CommandNotFoundException]
{
return download-Backup-without-curl $backupResource $authValue $hostname
}
catch [System.Exception]
{
Write-Host "Not able to download backup"
Write-Host $error[0].Exception
return
}
return $filePath
}
##### Function to download the Backup file without using the curl command #####
function download-Backup-without-curl ([PSCustomObject]$backupResource,[string]$authValue,[string]$hostname)
{
<#
.DESCRIPTION
Downloads the backup file from the appliance to the local system (without using curl)
.PARAMETER backupResource
Backup resource containing Uri for downloading
.PARAMETER authValue
The authorized sessionID
.PARAMETER hostname
The IP address of the appliance
.INPUTS
None, does not accept piping
.OUTPUTS
The absolute path of the download file
.EXAMPLE
download-backup-without-curl $backupResource $sessionID https://11.111.11.111
#>
# appends Uri ( obtained from previous function) to IP address
$downloadUri = $hostname + $backupResource.downloadUri
286 Ejemplos de secuencias de comandos de copia de seguridad y restauración
Vista de página 285
1 2 ... 281 282 283 284 285 286 287 288 289 290 291 ... 306 307

Comentários a estes Manuais

Sem comentários