From 011388183bb0c8e7a76a023a4bee78f37c548255 Mon Sep 17 00:00:00 2001 From: Gabe Date: Wed, 6 Aug 2025 17:52:44 +0000 Subject: [PATCH] Update Reinstall Scripts/App - Zoom Workplace - Reinstall.ps1 --- ...1 => App - Zoom Workplace - Reinstall.ps1} | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) rename Reinstall Scripts/{App - Zoom Workplace- Reinstall.ps1 => App - Zoom Workplace - Reinstall.ps1} (97%) diff --git a/Reinstall Scripts/App - Zoom Workplace- Reinstall.ps1 b/Reinstall Scripts/App - Zoom Workplace - Reinstall.ps1 similarity index 97% rename from Reinstall Scripts/App - Zoom Workplace- Reinstall.ps1 rename to Reinstall Scripts/App - Zoom Workplace - Reinstall.ps1 index 92e2e20..3ee5026 100644 --- a/Reinstall Scripts/App - Zoom Workplace- Reinstall.ps1 +++ b/Reinstall Scripts/App - Zoom Workplace - Reinstall.ps1 @@ -1,73 +1,73 @@ -<# -Author: Gabe Kerntke -Date: 03/14/25 - -.Synopsis -Script checks if Zoom is installed and then reinstalls it while also deleting each users appdata folder - -.Modified -- GabeK (3/14/25): Script created -#> - -[CmdletBinding()] -Param( - [Parameter(Mandatory = $false)] - $App_Name = "Zoom Workplace", - [Parameter(Mandatory = $false)] - $File_Name_Prefix = "zoom-x64", - [Parameter(Mandatory = $false)] - $File_Name_Extension = "msi", - [Parameter(Mandatory = $false)] - $Install_Parameters = "/quiet /qn /norestart", - [Parameter(Mandatory = $false)] - $EPCache_Folder = "3rd Party Patches\$App_Name", - [Parameter(Mandatory = $false)] - $OnlineVersion = (Invoke-RestMethod "https://zoom.us/rest/download?os=win").result.downloadVO.zoomX64.version, - [Parameter(Mandatory = $false)] - $DownloadURL = "https://zoom.us/client/latest/ZoomInstallerFull.msi?archType=x64", - [Parameter(Mandatory = $false)] - $File_Name = "$File_Name_Prefix-$Online_Version.$File_Name_Extension" -) - -# Functions # - -Function Uninstall-App { - $UninstallString = $Applist | Select-Object -ExpandProperty UninstallString - $UninstallString + " /qn" | cmd - Start-Sleep 5 - If (Get-Software | Where-Object { $_.DisplayName -like "*$AppName*" }) { - Write-Host "Failed to uninstall $AppName, exiting script." - Exit - } -} - -#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*") { - Close-App - Uninstall-App - Test-Probe_Online - Install-App -} -Else { Write-Host "$App_Name MSI version is not installed." } - -If ($Applist.DisplayName -notlike "*$App_Name*") { - #Check to see if program is installed per user - $Users = Get-ChildItem C:\Users - foreach ($User in $Users) { - $ZoomEXE = Test-Path "C:\Users\$($User.Name)\AppData\Roaming\Zoom\bin\Zoom.exe" -ErrorAction SilentlyContinue - $Path = "C:\Users\$($User.Name)\AppData\Roaming\Zoom" - If ($ZoomEXE -eq $True) { - Remove-Item $Path -Force -Recurse - Write-Output "$User $App_Name Appdata folder has been deleted." - } - Else { Write-Host "$App_Name not installed for $User." } - } -} +<# +Author: Gabe Kerntke +Date: 03/14/25 + +.Synopsis +Script checks if Zoom is installed and then reinstalls it while also deleting each users appdata folder + +.Modified +- GabeK (3/14/25): Script created +#> + +[CmdletBinding()] +Param( + [Parameter(Mandatory = $false)] + $App_Name = "Zoom Workplace", + [Parameter(Mandatory = $false)] + $File_Name_Prefix = "zoom-x64", + [Parameter(Mandatory = $false)] + $File_Name_Extension = "msi", + [Parameter(Mandatory = $false)] + $Install_Parameters = "/quiet /qn /norestart", + [Parameter(Mandatory = $false)] + $EPCache_Folder = "3rd Party Patches\$App_Name", + [Parameter(Mandatory = $false)] + $OnlineVersion = (Invoke-RestMethod "https://zoom.us/rest/download?os=win").result.downloadVO.zoomX64.version, + [Parameter(Mandatory = $false)] + $DownloadURL = "https://zoom.us/client/latest/ZoomInstallerFull.msi?archType=x64", + [Parameter(Mandatory = $false)] + $File_Name = "$File_Name_Prefix-$Online_Version.$File_Name_Extension" +) + +# Functions # + +Function Uninstall-App { + $UninstallString = $Applist | Select-Object -ExpandProperty UninstallString + $UninstallString + " /qn" | cmd + Start-Sleep 5 + If (Get-Software | Where-Object { $_.DisplayName -like "*$AppName*" }) { + Write-Host "Failed to uninstall $AppName, exiting script." + Exit + } +} + +#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*") { + Close-App + Uninstall-App + Test-Probe_Online + Install-App +} +Else { Write-Host "$App_Name MSI version is not installed." } + +If ($Applist.DisplayName -notlike "*$App_Name*") { + #Check to see if program is installed per user + $Users = Get-ChildItem C:\Users + foreach ($User in $Users) { + $ZoomEXE = Test-Path "C:\Users\$($User.Name)\AppData\Roaming\Zoom\bin\Zoom.exe" -ErrorAction SilentlyContinue + $Path = "C:\Users\$($User.Name)\AppData\Roaming\Zoom" + If ($ZoomEXE -eq $True) { + Remove-Item $Path -Force -Recurse + Write-Output "$User $App_Name Appdata folder has been deleted." + } + Else { Write-Host "$App_Name not installed for $User." } + } +} #Region Script End \ No newline at end of file