From 08a8a19a24d34ee16efcebfef8894ac793e26283 Mon Sep 17 00:00:00 2001 From: Gabe Date: Thu, 7 Aug 2025 19:21:59 +0000 Subject: [PATCH] Upload files to "App Install or Upgrade Scripts" --- ...App - GoToMeeting - Install or Upgrade.ps1 | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 App Install or Upgrade Scripts/App - GoToMeeting - Install or Upgrade.ps1 diff --git a/App Install or Upgrade Scripts/App - GoToMeeting - Install or Upgrade.ps1 b/App Install or Upgrade Scripts/App - GoToMeeting - Install or Upgrade.ps1 new file mode 100644 index 0000000..a893bb9 --- /dev/null +++ b/App Install or Upgrade Scripts/App - GoToMeeting - Install or Upgrade.ps1 @@ -0,0 +1,68 @@ +<# +Author: Gabe Kerntke +Date: 07-06-2023 + +.Synopsis +Script to install GoToMeeting on machines that do not already have it + +.Modified +2023-07-06 (GabeK) - Original script created +2025-08-07 (GabeK) - Updated to use functions script +#> + +[CmdletBinding()] +Param( + [Parameter(Mandatory = $false)] + $App_Name = "GoToMeeting", + [Parameter(Mandatory = $false)] + $File_Name_Prefix = "gotomeeting-x64", + [Parameter(Mandatory = $false)] + $File_Name_Extension = "msi", + [Parameter(Mandatory = $false)] + $Install_Parameters = "/quiet /G2MRUNATLOGON=false", + [Parameter(Mandatory = $false)] + $EPCache_Folder = "3rd Party Patches\$App_Name", + [Parameter(Mandatory = $false)] + $File_Name = "$File_Name_Prefix-$Online_Version.$File_Name_Extension" +) + + $initialURL = "https://link.gotomeeting.com/latest-msi" + #finds latest version from online + $request = [System.Net.WebRequest]::Create($initialURL) + $request.AllowAutoRedirect = $false + $response = $request.GetResponse() + $Program = $response.GetResponseHeader("Location") + + #more variables + $A = $Program.Substring(50) + $B = $A.Substring(0, $A.Length - 52) + $Online_VersionN = $B -replace "[^\d*\.?/\d*]" , '' -replace "/" , '' + $DownloadURL = $initialURL + +#Region Script Start +If ((Test-Path "C:\Temp\Script Cache") -eq $False) { New-Item -ItemType directory -Path "C:\Temp\Script Cache" } +Invoke-WebRequest -UseBasicParsing "https://scripts.gabesville.com/Gabesville/Powershell-Scripts/raw/branch/main/Functions%20Scripts/Functions.ps1" -outfile "C:\Temp\Script Cache\Functions.ps1" +. "C:\Temp\Script Cache\Functions.ps1" + +#Check to see if program is installed +$Applist = Get-Software | Sort-Object -Descending + +If ($Applist.DisplayName -like "*$App_Name*") { + + #Get currently installed version + $Local_Version = Get-Software | Where-Object { $_.DisplayName -like "*$App_Name*" } | Select-Object -ExpandProperty DisplayVersion + + #Comparing version already installed to what is online + If ([version]$Local_Version -lt [version]$Online_Version) { + Test-Probe_Online + Close-App + Install-App + } + Else { Write-Host "$App_Name already on latest version (Installed version: $Local_Version)" } +} + +Else { + Test-Probe_Online + Install-App +} +#Region Script End \ No newline at end of file