forked from ramoj25/AIB
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Installteams.ps1
34 lines (30 loc) · 1.34 KB
/
Installteams.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
#testing the pull request.
$path = "c:\temp"
if([IO.Directory]::Exists($path))
{
#Do Nothing!!
}
else
{
#Create a temp folder for downloads
New-Item -Type Directory -Path 'c:\' -Name "temp"
}
write-host "create logs in temp folder"
#Set the Teams Registry key
$Name = "IsWVDEnvironment"
$value = "1"
#Add Registry Path
if (!(Test-Path "HKLM:\SOFTWARE\Microsoft\Teams")) {
New-Item -ErrorAction Stop -Path "HKLM:\SOFTWARE\Microsoft\Teams" -Force
}
#Add VDI Registry Value
New-ItemProperty -ErrorAction Stop -Path "HKLM:\SOFTWARE\Microsoft\Teams" -Name $name -Value $value -PropertyType DWORD -Force
write-host "Finshed registry configuration"
#Install the WebRTC redirect service
Invoke-WebRequest -uri 'https://query.prod.cms.rt.microsoft.com/cms/api/am/binary/RWWDIg' -OutFile 'c:\temp\MsRdcWebRTCSvc_x64.msi'
Start-Process -filepath msiexec.exe -Wait -ErrorAction Stop -ArgumentList '/i c:\temp\MsRdcWebRTCSvc_x64.msi /quiet /norestart'
write-host "downloaded webrtc and installed"
#Download the installer to the C:\temp
Invoke-WebRequest -Uri 'https://teams.microsoft.com/downloads/desktopurl?env=production&plat=windows&download=true&managedInstaller=true&arch=x64' -OutFile 'c:\temp\Teams.msi'
Invoke-Expression -Command 'msiexec /i C:\temp\Teams.msi /quiet /l*v C:\temp\teamsinstall.log ALLUSER=1'
write-host "downloaded teams and installed."