|
2321 | 2321 | "Microsoft.ZuneMusic", |
2322 | 2322 | "Microsoft.ZuneVideo", |
2323 | 2323 | "Microsoft.MicrosoftOfficeHub", |
| 2324 | + "MsTeams", |
2324 | 2325 | "*EclipseManager*", |
2325 | 2326 | "*ActiproSoftwareLLC*", |
2326 | 2327 | "*AdobeSystemsIncorporated.AdobePhotoshopExpress*", |
|
2350 | 2351 | ], |
2351 | 2352 | "InvokeScript": [ |
2352 | 2353 | " |
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 |
2369 | 2359 |
|
2370 | 2360 | 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 | + } |
2385 | 2363 | " |
2386 | 2364 | ], |
2387 | 2365 | "link": "https://winutil.christitus.com/dev/tweaks/z--advanced-tweaks---caution/debloat" |
|
0 commit comments