-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetWVDClient.ps1
43 lines (40 loc) · 1.31 KB
/
setWVDClient.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
33
34
35
36
37
38
39
40
41
42
43
param (
[string]$registrationtoken = $(throw "-registrationtoken is required.")
)
mkdir .\temp
Set-Location .\temp
#Download WVD Agent Installer
try {
Invoke-WebRequest 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWrmXv' -UseBasicParsing -OutFile 'WVD-Agent.msi'
"Downloaded WVD Agent Installer"
}
catch {
Throw "WVD Agent Installer is not downloaded"
}
#Install WVD Agent
try {
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i WVD-Agent.msi", "/quiet", "/qn", "/norestart", "/passive", "REGISTRATIONTOKEN=$($registrationtoken)" -Wait
"Installed WVD Agent"
}
catch {
Throw "WVD Agent not installed $_"
}
#Download WVD BootLoader Installer
try {
Invoke-WebRequest 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWrxrH' -UseBasicParsing -OutFile 'WVD-BootLoader.msi'
"Downloaded WVD BootLoader Installer"
}
catch {
Throw "WVD BootLoader Installer is not downloaded"
}
#Install WVD BootLoader
try {
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i WVD-BootLoader.msi", "/quiet", "/qn", "/norestart", "/passive" -Wait
"Installed WVD BootLoader"
}
catch {
Throw "WVD BootLoader not installed $_"
}
Set-Location ..
Remove-Item -Recurse -Force .\temp
Remove-Item -Force $MyInvocation.MyCommand.Path