mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-09 17:41:14 +10:00
Feature/appx removal tab (#4729)
* feat: add config-driven AppX package removal tab - Add config/appx.json with curated list of removable AppX packages - Add AppX Removal tab (WPFTab6) with Select All, Clear, and Remove buttons - Reuse existing Invoke-WPFUIElements engine for minimal code footprint - Add Invoke-WPFAppxRemoval.ps1 for background runspace package removal - Add theme colors for the new tab button in light and dark modes * yep * yep * yep * yep * Update inputXML.xaml * Update Invoke-WPFButton.ps1 * Update Invoke-WPFButton.ps1 * Update Invoke-WPFSelectedCheckboxesUpdate.ps1 * Update appx.json * Update appx.json * Update appx.json * Update tweaks.json * Update appx.json * Update appx.json * Update appx.json * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFButton.ps1 * Delete functions/public/Invoke-WPFAppxRemoval.ps1 * Revert "Update Invoke-WPFButton.ps1" This reverts commitd8705cc08e. * Revert "Delete functions/public/Invoke-WPFAppxRemoval.ps1" This reverts commit9e45d1ad99. * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFButton.ps1 * yep * Update appx.json * Update appx.json * Update tweaks.json * Update start.ps1 * Update preset.json * Update tweaks.json * yep * yep * yep * yep * yep * yep * Update Invoke-WPFAppxRemoval.ps1 * Update Update-WinUtilSelections.ps1 * Update Update-WinUtilSelections.ps1 * yep * Update Invoke-WPFAppxRemoval.ps1 * yep * yep * Update Invoke-WPFAppxRemoval.ps1 * Update appx.json * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update appx.json * Update Invoke-WPFGetInstalled.ps1 * Update Invoke-WPFAppxRemoval.ps1 * yep * yep * Update Invoke-WPFSelectedCheckboxesUpdate.ps1 * yep * yep * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * yep * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update appx.json * Update Invoke-WPFImpex.ps1 * Update Invoke-WPFImpex.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update preset.json * Update preset.json * Update Invoke-WPFSelectedCheckboxesUpdate.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update tweaks.json * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * Update Invoke-WPFAppxRemoval.ps1 * yep * yep * Update Invoke-WPFAppxRemoval.ps1 * yep * Delete functions/private/Find-AppxByNameOrDescription.ps1 * yep * Update Invoke-WPFButton.ps1 * Update main.ps1 * Update Invoke-WPFTab.ps1 * yep * yep * Update themes.json
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
function Invoke-WPFAppxRemoval {
|
||||
if (-not ($sync.selectedAppx)) {
|
||||
[System.Windows.Forms.MessageBox]::Show("No AppX Package selected","Error","OK","Error")
|
||||
return
|
||||
}
|
||||
|
||||
$selected = $sync.selectedAppx
|
||||
$apps = $sync.configs.appxHashtable
|
||||
|
||||
$handle = Invoke-WPFRunspace -ParameterList @(("selected", $selected), ("apps", $apps)) -ScriptBlock {
|
||||
param($selected, $apps)
|
||||
|
||||
$sync.ProcessRunning = $true
|
||||
|
||||
foreach ($key in $selected) {
|
||||
if ($key -eq "WPFAppxMicrosoft_XboxGamingOverlay") {
|
||||
# Making sure Game Bar isn't running
|
||||
Stop-Process -Name GameBarFTServer
|
||||
|
||||
# This stops annoying ms-gamebar popup when launching games.
|
||||
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR -Name AppCaptureEnabled -Value 0
|
||||
}
|
||||
|
||||
if ($key -eq "WPFAppxMicrosoft_WindowsNotepad") {
|
||||
# i hope your having fun reading this
|
||||
Stop-Process -Name dllhost
|
||||
}
|
||||
|
||||
Write-Host "Removing $($apps[$key].Content)"
|
||||
Get-AppxPackage -Name $apps[$key].PackageId -AllUsers | Remove-AppxPackage -AllUsers
|
||||
|
||||
if ($key -eq "WPFAppxMSTeams") {
|
||||
# Uninstalls Microsoft Teams Meeting Add-in for Microsoft Office
|
||||
Get-Package -Name "Microsoft Teams*" -ErrorAction SilentlyContinue | Uninstall-Package -Force
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "================================="
|
||||
Write-Host "-- AppX Removal Finished ---"
|
||||
Write-Host "================================="
|
||||
|
||||
$sync.ProcessRunning = $false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user