Upload files to "App Uninstall Scripts"
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<#
|
||||
Author: Gabe Kerntke
|
||||
Date: 05-28-2024
|
||||
|
||||
.Synopsis
|
||||
Script checks to see if Dell SupportAssist is installed, if installed it will uninstall
|
||||
|
||||
.Modified
|
||||
2024-05-28 (GabeK) - Original script created
|
||||
2025-04-09 (GabeK) - Rewrote script since it was bluescreening systems
|
||||
2025-06-12 (GabeK) - Rewrote to use functions script and to also uninstall Dell SupportAssist OS Recovery Plugin
|
||||
#>
|
||||
|
||||
# Variables #
|
||||
$App_Name = "Dell SupportAssist"
|
||||
$App_Name2 = "Dell SupportAssist OS Recovery Plugin for Dell Update"
|
||||
$App_Name3 = "Dell SupportAssist Remediation"
|
||||
$StoreVersion = "Get-AppxPackage | Select-Object Name, PackageFullName | Format-List"
|
||||
$Install_Parameters = "/silent /install"
|
||||
$Uninstall_Parameters = " /qn /quiet /norestart"
|
||||
$Program_Folder = "C:\Program Files\Dell\SupportAssistAgent"
|
||||
$Program_Folder2 = "C:\Program Files\Dell\SARemediation"
|
||||
|
||||
# Functions #
|
||||
Function Uninstall-App {
|
||||
If ($StoreVersion -contains "*DellSupport*") {
|
||||
Get-AppxPackage -Name "*DellSupport*" | Select-Object -ExpandProperty PackageFullName | Remove-AppPackage
|
||||
Start-Sleep 10
|
||||
Uninstall-App_UninstallString
|
||||
}
|
||||
Else { Uninstall-App_UninstallString }
|
||||
}
|
||||
|
||||
#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 | Where-Object { $_.DisplayName -eq $App_Name }) {
|
||||
Uninstall-App
|
||||
}
|
||||
Else {
|
||||
Write-Output "$App_Name is not installed"
|
||||
}
|
||||
If ($Applist | Where-Object { $_.DisplayName -eq $App_Name2 }) {
|
||||
$App_Name = $App_Name2
|
||||
Uninstall-App
|
||||
}
|
||||
Else {
|
||||
Write-Output "$App_Name2 is not installed"
|
||||
}
|
||||
If ($Applist | Where-Object { $_.DisplayName -eq $App_Name3 }) {
|
||||
$App_Name = $App_Name3
|
||||
Uninstall-App
|
||||
}
|
||||
Else {
|
||||
Write-Output "$App_Name3 is not installed"
|
||||
}
|
||||
|
||||
#Region Script End
|
||||
Reference in New Issue
Block a user