Skip to content

Commit cff4eda

Browse files
Merge pull request #310 from silversword411/main
Add Die Crapware scripts
2 parents c6284e3 + ff494d7 commit cff4eda

File tree

4 files changed

+1757
-0
lines changed

4 files changed

+1757
-0
lines changed
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
<#
2+
NOTES
3+
v1.0 10/23/2024 silversword411 initial version
4+
v1.1 10/29/2024 silversword411 Adding old powerdirector apps
5+
v1.2 12/13/2024 silversword411 Removing system apps
6+
v1.3 1/29/2025 silversword411 DellInc.PartnerPromo, DellWatchdogTimer
7+
v1.4 2/9/2025 silversword411 foldercreate and runasuser snippet
8+
v1.5 2/17/2025 silversword411 added Dell Update universal
9+
10+
#>
11+
12+
param(
13+
[switch]$debug
14+
)
15+
16+
{ { foldercreate } }
17+
18+
if ($debug) {
19+
$DebugPreference = "Continue"
20+
}
21+
else {
22+
$DebugPreference = "SilentlyContinue"
23+
$ErrorActionPreference = 'silentlycontinue'
24+
}
25+
26+
if (-not ((Get-WmiObject -Class Win32_ComputerSystem).Manufacturer -like "*Dell*")) {
27+
Write-Output "Not a Dell. Exit"
28+
exit 0
29+
}
30+
31+
Foldercreate -Paths "$env:ProgramData\TacticalRMM\temp"
32+
33+
### Uninstall functions
34+
35+
36+
Function Remove-App-MSI-QN([String]$appName) {
37+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, `
38+
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
39+
Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } |
40+
Select-Object -Property DisplayName, UninstallString
41+
42+
if ($appCheck) {
43+
Write-Host "Uninstalling $($appCheck.DisplayName)"
44+
$uninstallCommand = $appCheck.UninstallString -replace "/I", "/X"
45+
$uninstallCommand += " /quiet /norestart"
46+
47+
try {
48+
Start-Process -FilePath "cmd.exe" -ArgumentList "/c $uninstallCommand" -Wait
49+
Write-Host "$($appCheck.DisplayName) uninstalled successfully."
50+
}
51+
catch {
52+
Write-Error "Failed to uninstall $($appCheck.DisplayName). Error: $_"
53+
}
54+
}
55+
else {
56+
Write-Host "$appName is not installed on this computer."
57+
}
58+
}
59+
60+
61+
Function Remove-App-EXE-SILENT([String]$appName) {
62+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
63+
if ($appCheck -ne $null) {
64+
Write-host "Uninstalling "$appCheck.DisplayName
65+
$uninst = $appCheck.UninstallString + " -silent"
66+
cmd /c $uninst
67+
}
68+
else {
69+
Write-Host "$appName is not installed on this computer"
70+
}
71+
}
72+
73+
74+
Function Remove-App-MSI_EXE-Quiet([String]$appName) {
75+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
76+
if ($appCheck -ne $null) {
77+
Write-host "Uninstalling "$appCheck.DisplayName
78+
$uninst = $appCheck.UninstallString[1] + " /qn /restart"
79+
cmd /c $uninst
80+
81+
}
82+
else {
83+
Write-Host "$appName is not installed on this computer"
84+
}
85+
}
86+
87+
88+
Function Remove-App-MSI_EXE-S([String]$appName) {
89+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
90+
if ($appCheck -ne $null) {
91+
Write-host "Uninstalling "$appCheck.DisplayName
92+
$uninst = $appCheck.UninstallString[1] + " /S"
93+
cmd /c $uninst
94+
95+
}
96+
else {
97+
Write-Host "$appName is not installed on this computer"
98+
}
99+
}
100+
101+
102+
Function Remove-App-MSI-I-QN([String]$appName) {
103+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
104+
if ($appCheck -ne $null) {
105+
Write-host "Uninstalling "$appCheck.DisplayName
106+
$uninst = $appCheck.UninstallString.Replace("/I", "/X") + " /qn /norestart"
107+
cmd /c $uninst
108+
}
109+
else {
110+
Write-Host "$appName is not installed on this computer"
111+
}
112+
}
113+
114+
115+
Function Remove-App([String]$appName) {
116+
$app = Get-AppxPackage -AllUsers | Where-Object { $_.Name -like $appName }
117+
if ($app) {
118+
foreach ($package in $app) {
119+
$packageFullName = $package.PackageFullName
120+
Write-Host "Uninstalling $appName ($packageFullName)"
121+
Remove-AppxPackage -Package $packageFullName -AllUsers
122+
}
123+
124+
$provApp = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like $appName }
125+
if ($provApp) {
126+
foreach ($provisionedPackage in $provApp) {
127+
$proPackageFullName = $provisionedPackage.PackageName
128+
Write-Host "Uninstalling provisioned $appName ($proPackageFullName)"
129+
Remove-AppxProvisionedPackage -Online -PackageName $proPackageFullName
130+
}
131+
}
132+
}
133+
else {
134+
Write-Host "$appName is not installed on this computer"
135+
}
136+
}
137+
138+
139+
Function Remove-System-App([String]$appName) {
140+
# Remove installed appx packages for all users
141+
$appMatches = Get-AppxPackage -AllUsers | Where-Object { $_.Name -like $appName }
142+
if ($appMatches) {
143+
foreach ($app in $appMatches) {
144+
$packageFullName = $app.PackageFullName
145+
Write-Host "Uninstalling installed system app: $appName ($packageFullName)"
146+
try {
147+
Remove-AppxPackage -Package $packageFullName -AllUsers
148+
}
149+
catch {
150+
Write-Error "Failed to remove installed package: $packageFullName. Error: $_"
151+
}
152+
}
153+
}
154+
else {
155+
Write-Host "$appName is not installed for any user."
156+
}
157+
158+
# Remove provisioned appx packages
159+
$provAppMatches = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like $appName }
160+
if ($provAppMatches) {
161+
foreach ($provApp in $provAppMatches) {
162+
$provPackageFullName = $provApp.PackageName
163+
Write-Host "Uninstalling provisioned system app: $appName ($provPackageFullName)"
164+
try {
165+
Remove-AppxProvisionedPackage -Online -PackageName $provPackageFullName
166+
}
167+
catch {
168+
Write-Error "Failed to remove provisioned package: $provPackageFullName. Error: $_"
169+
}
170+
}
171+
}
172+
else {
173+
Write-Host "$appName is not provisioned on this computer."
174+
}
175+
}
176+
177+
178+
Function Check-UninstallString([String]$appName) {
179+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
180+
if ($appCheck -ne $null) {
181+
Write-host $appCheck.DisplayName $appCheck.UninstallString
182+
}
183+
else {
184+
Write-Host "$appName is not installed on this computer"
185+
}
186+
}
187+
188+
189+
Function Remove-App-EXE-S-QUOTES([String]$appName) {
190+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -eq $appName } | Select-Object -Property DisplayName, UninstallString
191+
if ($appCheck -ne $null) {
192+
Write-host "Uninstalling "$appCheck.DisplayName
193+
$uninst = "`"" + $appCheck.UninstallString + "`"" + " /S"
194+
cmd /c $uninst
195+
}
196+
else {
197+
Write-Host "$appName is not installed on this computer"
198+
}
199+
}
200+
201+
202+
Function Debug-AppInfo([String]$appName) {
203+
Write-Host "DEBUG: Checking for app: $appName"
204+
205+
# Check installed AppxPackage for all users
206+
$appMatches = Get-AppxPackage -AllUsers | Where-Object { $_.Name -like $appName }
207+
if ($appMatches) {
208+
Write-Host "Installed AppxPackages found:"
209+
$appMatches | Format-Table -Property Name, PackageFullName, Publisher
210+
}
211+
else {
212+
Write-Host "No installed AppxPackages found matching: $appName"
213+
}
214+
215+
# Check provisioned packages
216+
$provAppMatches = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -like $appName }
217+
if ($provAppMatches) {
218+
Write-Host "Provisioned AppxPackages found:"
219+
$provAppMatches | Format-Table -Property DisplayName, PackageName
220+
}
221+
else {
222+
Write-Host "No provisioned AppxPackages found matching: $appName"
223+
}
224+
225+
# Check MSI/EXE installations in registry
226+
$appCheck = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, `
227+
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall |
228+
Get-ItemProperty | Where-Object { $_.DisplayName -like "*$appName*" }
229+
if ($appCheck) {
230+
Write-Host "MSI/EXE installations found in registry:"
231+
$appCheck | Format-Table -Property DisplayName, UninstallString
232+
}
233+
else {
234+
Write-Host "No MSI/EXE installations found in registry matching: $appName"
235+
}
236+
}
237+
238+
239+
Remove-App-MSI-I-QN "Dell Trusted Device Agent"
240+
Remove-App-MSI-QN "Dell Update for Windows Universal"
241+
Remove-App-EXE-S-QUOTES "Dell Pair"
242+
Remove-App-MSI-QN "Dell SupportAssist"
243+
Remove-App-MSI-QN "Dell Digital Delivery"
244+
Remove-App-MSI_EXE-S "Dell SupportAssist Remediation"
245+
Remove-App "DellInc.DellDigitalDelivery"
246+
Remove-App "*DellInc.DellCustomerConnect"
247+
Remove-App "*DellInc.PartnerPromo"
248+
Remove-App "*DellWatchdogTimer"
249+
#Remove-App "*DellInc.MyDell"
250+
Remove-App "DellInc.DellUpdate"
251+
Remove-App "DB6EA5DB.PowerMediaPlayerforDell"
252+
Remove-App "DB6EA5DB.Power2GoforDell"
253+
Remove-App "DB6EA5DB.PowerDirectorforDell"
254+
Remove-App "DB6EA5DB.MediaSuiteEssentialsforDell"
255+
Remove-App-MSI-QN "Dell Digital Delivery Services"
256+
Remove-App-EXE-S-QUOTES "Dell Display Manager 2.2"
257+
Remove-App-EXE-S-QUOTES "Dell Peripheral Manager"
258+
Remove-App-MSI-I-QN "Dell Core Services"
259+
# Remove-App-MSI-I-QN "Dell Optimizer" Doesn't work on EHILL2025
260+
# Remove-App-EXE-S-QUOTES "MyDell" Doesn't work on EHILL2025 not a silent uninstaller and linked with Optimizer
261+
Remove-System-App "5A894077.McAfeeSecurity"
262+
Remove-System-App "DellInc.DellProductRegistration"
263+
#Debug-AppInfo "Dell Digital Delivery"
264+
265+
if ($debug) {
266+
Write-Output "***************** Debugging info *****************"
267+
268+
Write-Output "`n==== Debug: All Uninstall Items (Wrapped Table) ===="
269+
Get-ItemProperty `
270+
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*, `
271+
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
272+
-ErrorAction SilentlyContinue |
273+
Where-Object { $_.DisplayName } |
274+
Sort-Object DisplayName |
275+
Select-Object DisplayName, UninstallString, Publisher |
276+
Format-Table -AutoSize -Wrap
277+
278+
279+
Write-Output "`n==== List of User Apps (Appx) from System (-AllUsers) ===="
280+
Get-AppxPackage -AllUsers |
281+
Sort-Object -Property Name |
282+
Format-Table Name,
283+
@{Label = "Publisher"; Expression = { $_.Publisher.Substring(0, [Math]::Min(20, $_.Publisher.Length)) } }
284+
285+
Write-Output "`n==== List of System Apps (Provisioned) ===="
286+
Get-AppxProvisionedPackage -Online |
287+
Sort-Object -Property DisplayName |
288+
Format-Table DisplayName,
289+
@{Label = "Publisher"; Expression = { $_.Publisher.Substring(0, [Math]::Min(20, $_.Publisher.Length)) } }
290+
}

0 commit comments

Comments
 (0)