Skip to content

Commit 8b3e128

Browse files
author
Gabi
authored
Update-WPFTweaksDeBloat (ChrisTitusTech#3709)
* Update tweaks.json * Update tweaks.json * Update tweaks.json * Update tweaks.json * Update tweaks.json * Added comments to InvokeScript of WPFTweaksDeBloat * Update tweaks.json * Update tweaks.json
1 parent ce77be3 commit 8b3e128

1 file changed

Lines changed: 8 additions & 30 deletions

File tree

config/tweaks.json

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,6 +2321,7 @@
23212321
"Microsoft.ZuneMusic",
23222322
"Microsoft.ZuneVideo",
23232323
"Microsoft.MicrosoftOfficeHub",
2324+
"MsTeams",
23242325
"*EclipseManager*",
23252326
"*ActiproSoftwareLLC*",
23262327
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*",
@@ -2350,38 +2351,15 @@
23502351
],
23512352
"InvokeScript": [
23522353
"
2353-
$TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams')
2354-
$TeamsUpdateExePath = [System.IO.Path]::Combine($TeamsPath, 'Update.exe')
2355-
2356-
Write-Host \"Stopping Teams process...\"
2357-
Stop-Process -Name \"*teams*\" -Force -ErrorAction SilentlyContinue
2358-
2359-
Write-Host \"Uninstalling Teams from AppData\\Microsoft\\Teams\"
2360-
if ([System.IO.File]::Exists($TeamsUpdateExePath)) {
2361-
# Uninstall app
2362-
$proc = Start-Process $TeamsUpdateExePath \"-uninstall -s\" -PassThru
2363-
$proc.WaitForExit()
2364-
}
2365-
2366-
Write-Host \"Removing Teams AppxPackage...\"
2367-
Get-AppxPackage \"*Teams*\" | Remove-AppxPackage -ErrorAction SilentlyContinue
2368-
Get-AppxPackage \"*Teams*\" -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue
2354+
$TeamsPath = \"$Env:LocalAppData\\Microsoft\\Teams\\Update.exe\"
2355+
2356+
if (Test-Path $TeamsPath) {
2357+
Write-Host \"Uninstalling Teams\"
2358+
Start-Process $TeamsPath -ArgumentList -uninstall -wait
23692359

23702360
Write-Host \"Deleting Teams directory\"
2371-
if ([System.IO.Directory]::Exists($TeamsPath)) {
2372-
Remove-Item $TeamsPath -Force -Recurse -ErrorAction SilentlyContinue
2373-
}
2374-
2375-
Write-Host \"Deleting Teams uninstall registry key\"
2376-
# Uninstall from Uninstall registry key UninstallString
2377-
$us = (Get-ChildItem -Path HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall, HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -like '*Teams*'}).UninstallString
2378-
if ($us.Length -gt 0) {
2379-
$us = ($us.Replace('/I', '/uninstall ') + ' /quiet').Replace(' ', ' ')
2380-
$FilePath = ($us.Substring(0, $us.IndexOf('.exe') + 4).Trim())
2381-
$ProcessArgs = ($us.Substring($us.IndexOf('.exe') + 5).Trim().replace(' ', ' '))
2382-
$proc = Start-Process -FilePath $FilePath -Args $ProcessArgs -PassThru
2383-
$proc.WaitForExit()
2384-
}
2361+
Remove-Item $TeamsPath -Recurse -Force
2362+
}
23852363
"
23862364
],
23872365
"link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/debloat"

0 commit comments

Comments
 (0)