forked from ryancbutler/azurectxvda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ctxvda.ps1
32 lines (30 loc) · 1.12 KB
/
ctxvda.ps1
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
$filename = "VDAServerSetup_7.18.exe"
$url = "http:\\MYURL.COM\"
$UnattendedArgs = "/quiet /optimize /components vda /controllers 'mycontroller.domain.com' /enable_remote_assistance /enable_hdx_ports /enable_real_time_transport /virtualmachine /noreboot /noresume /logpath 'C:\Windows\Temp\VDA' /masterimage"
$filepath = "$($env:SystemRoot)\temp\"
if(test-path ("$filepath\$filename"))
{
Write-host "File already exists. Resuming install"
$exit = (Start-Process ("C:\ProgramData\Citrix\XenDesktopSetup\XenDesktopVdaSetup.exe") -Wait -Verbose -Passthru).ExitCode
}
else
{
Write-Host "Downloading $filename"
Invoke-WebRequest -Uri ($url + $filename) -OutFile "$filepath\$filename" -Verbose -UseBasicParsing
write-host "Installing VDA..."
$exit = (Start-Process ("$filepath\$filename") $UnattendedArgs -Wait -Verbose -Passthru).ExitCode
}
if ($exit -eq 0)
{
write-host "VDA INSTALL COMPLETED!"
}
elseif ($exit -eq 3)
{
write-host "REBOOT NEEDED!"
}
elseif ($exit -eq 1)
{
#dump log
get-content "C:\Windows\Temp\VDA\Citrix\XenDesktop Installer\XenDesktop Installation.log"
throw "Install FAILED! Check Log"
}