diff --git a/WebRTC Auto Updater/Detect - WebRTC - Detection Script - 0.2.3.ps1 b/WebRTC Auto Updater/Detect - WebRTC - Detection Script.ps1 similarity index 83% rename from WebRTC Auto Updater/Detect - WebRTC - Detection Script - 0.2.3.ps1 rename to WebRTC Auto Updater/Detect - WebRTC - Detection Script.ps1 index 408eef0..00eedfd 100644 --- a/WebRTC Auto Updater/Detect - WebRTC - Detection Script - 0.2.3.ps1 +++ b/WebRTC Auto Updater/Detect - WebRTC - Detection Script.ps1 @@ -4,7 +4,7 @@ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT See LICENSE in the project root for license information. #> -# Version 0.2.3 +# Version 0.3.1 # ##################################### @@ -17,8 +17,7 @@ Param( function get-CurrentRTCver { $response = (Invoke-WebRequest -Uri "https://aka.ms/msrdcwebrtcsvc/msi" -UseBasicParsing) - $response.headers.'Content-Disposition' - $versionC = $response.Headers.'Content-Disposition' -replace ".*HostSetup_", "" -replace ".x64.msi*", "" + $versionC = $response.BaseResponse.ResponseUri.AbsolutePath -replace ".*HostSetup_", "" -replace ".x64.msi*", "" $string = "The latest available version of the WebRTC client is " + $versionC update-log -Data $string -Class Information -output both $global:currentversion = $versionC @@ -85,11 +84,24 @@ function get-teamsinstall { } if ($count -eq '0') { - update-log -data "Teams install not found. User may not have logged into machine yet. Returning Compliant" -Class Information -Output Both - Exit 0 + update-log -data "Classic Teams install not found. Checking for New Teams." -Class Information -Output Both + #Exit 0 + $appxpacks = Get-ChildItem 'C:\Program Files\WindowsApps' + + foreach ($appxpack in $appxpacks){ + if ($appxpack -match "MSTeams"){$count = $count + 1} + } + if ($count -eq 0){ + update-log -data "New Teams not found. Teams is not installed. Returning compliant." -Class Information -Output Both + Exit 0 + } + else{ + update-log -data "New Teams installation has been found" -Class Information -Output Both + } + } else { - update-log -data "Teams install found." -Class Information -Output Both + update-log -data "Old Teams install found." -Class Information -Output Both } } @@ -136,3 +148,4 @@ if ($RTCInstalled -eq $RTCCurrent) { update-log -Data "The WebRTC client is current. Returning Compliant" -Class Information -output both Exit 0 } + diff --git a/WebRTC Auto Updater/Remediate - WebRTC - Remediation Script - 0.2.8.ps1 b/WebRTC Auto Updater/Remediate - WebRTC - Remediation Script.ps1 similarity index 92% rename from WebRTC Auto Updater/Remediate - WebRTC - Remediation Script - 0.2.8.ps1 rename to WebRTC Auto Updater/Remediate - WebRTC - Remediation Script.ps1 index ba3ecdf..81b694e 100644 --- a/WebRTC Auto Updater/Remediate - WebRTC - Remediation Script - 0.2.8.ps1 +++ b/WebRTC Auto Updater/Remediate - WebRTC - Remediation Script.ps1 @@ -5,7 +5,7 @@ See LICENSE in the project root for license information. #> -# Version 0.2.8 +# Version 0.3.1 ##################################### @@ -63,20 +63,20 @@ function get-userstate { #function to perform the upgrading function invoke-remediation { $folders = Get-ChildItem -Path C:\users -Directory -force -ErrorAction SilentlyContinue | select fullname, name - $TeamsReg = "HKCU:\Software\Microsoft\Office\Teams" - $TeamRegExist = test-path -path $TeamsReg + #$TeamsReg = "HKCU:\Software\Microsoft\Office\Teams" + #$TeamRegExist = test-path -path $TeamsReg $RTCCurrent = get-CurrentRTCver $global:currentversion $RTCInstalled = get-installedRTCver try { - if ($TeamRegExist -eq $True) { - $PreventInstallStateKey = Get-Item -Path $TeamsReg - $preventInstall = $PreventInstallStateKey.GetValue("PreventInstallationFromMsi") - if ($preventInstall -ne $null) { - update-log -data "Removing PreventInstallationFromMsi reg key" -Class Information -output both - Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "PreventInstallationFromMsi" - } - } + #if ($TeamRegExist -eq $True) { + # $PreventInstallStateKey = Get-Item -Path $TeamsReg + # $preventInstall = $PreventInstallStateKey.GetValue("PreventInstallationFromMsi") + # if ($preventInstall -ne $null) { + # update-log -data "Removing PreventInstallationFromMsi reg key" -Class Information -output both + # Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Office\Teams" -Name "PreventInstallationFromMsi" + # } + #} #Create a directory to save download files $tempCreated = $false @@ -202,8 +202,7 @@ function invoke-disctimer { #function to query the latest available version number of WebRTC client function get-CurrentRTCver { $response = (Invoke-WebRequest -Uri "https://aka.ms/msrdcwebrtcsvc/msi" -UseBasicParsing) - $response.headers.'Content-Disposition' - $versionC = $response.Headers.'Content-Disposition' -replace ".*HostSetup_", "" -replace ".x64.msi*", "" + $versionC = $response.BaseResponse.ResponseUri.AbsolutePath -replace ".*HostSetup_", "" -replace ".x64.msi*", "" $string = "The latest available version of the WebRTC client is " + $versionC update-log -Data $string -Class Information -output both $global:currentversion = $versionC