-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.updateVeeam
More file actions
82 lines (39 loc) · 1.6 KB
/
install.updateVeeam
File metadata and controls
82 lines (39 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
instalaVeean.ps1
$workdir = "c:\installer\"
$LicenseFile = "$workdir\Veeamlicense.lic"
$ConfigFile = "$workdir\config.xml"
[Object[]]$List = @(
#Instalador
New-Object -TypeName PSObject -Property @{"File" = "$workdir\Veeam2.exe"; "URL" = ""}
##Licencia
New-Object -TypeName PSObject -Property @{"File" = $LicenseFile; "URL" = ""}
##Archivo de configuracion
New-Object -TypeName PSObject -Property @{"File" = $ConfigFile; "URL" = ""}
)
$VeeamInstallDir = "C:\Program Files\Veeam\Endpoint Backup"
# Valida sie xiste el directorio si no lo crea
If (Test-Path -Path $workdir -PathType Container)
{ Write-Host "$workdir\ already exists" -ForegroundColor Red}
ELSE
{ New-Item -Path $workdir -ItemType directory }
# Busca si existe Invoke-Webrequest; si no ejecuta WebClient
$List | ForEach-Object {
if (Get-Command 'Invoke-Webrequest') {
Invoke-WebRequest $_.URL -OutFile $_.File
}
else {
$WebClient = New-Object System.Net.WebClient
$webclient.DownloadFile($_.URL, $_.File)
}
}
# Empieza la instalacion
Start-Process -FilePath "$workdir\Veeam2.exe" -ArgumentList "/silent /accepteula"
# Espera n Segundos para finalizar la instalacion
Start-Sleep -s 45
#Para el proceso
Stop-Process -Name "Veeam.EndPoint.Tray" -Force -ErrorAction SilentlyContinue
#Realiza la importacio de la licencia
Set-Location $VeeamInstallDir
Start-Process Veeam.Agent.Configurator.exe -ArgumentList "-license /f:'$LicenseFile'"
Start-Process Veeam.Agent.Configurator.exe -ArgumentList "-import /f:'$ConfigFile'"
Start-Process "$VeeamInstallDir\Veeam.EndPoint.Tray.exe"