mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-09 17:41:14 +10:00
* Harden Pester CI and discard runspace return values * Add prioritized test backlog * Add WinUtil action logging * Add config integrity tests * Add XAML control wiring tests * Add registry and service helper tests * Add package manager tests * Add runspace behavior tests * Add tweak orchestration tests * Add install workflow tests * Add update profile tests * Add AppX removal tests * Log package installer output * Add UI state helper tests * Pin Pester test runner version * Expand Win11 Creator tests * Add preferences and theme tests * Add search filter tests * Add compile contract tests * Use single WinUtil session log * Remove installer output logging helper * Handle locked WinUtil transcript log * Avoid appending to active transcript log * Log install uninstall package identities
52 lines
2.4 KiB
PowerShell
52 lines
2.4 KiB
PowerShell
function Invoke-WPFAppxRemoval {
|
|
if ($null -eq $sync.selectedAppx -or $sync.selectedAppx.Count -eq 0) {
|
|
Show-WinUtilMessage -Message "No AppX Package selected" -Title "Error" -Button "OK" -Icon "Error"
|
|
return
|
|
}
|
|
|
|
$selected = $sync.selectedAppx
|
|
$apps = $sync.configs.appxHashtable
|
|
|
|
$handle = Invoke-WPFRunspace -ParameterList @(("selected", $selected), ("apps", $apps)) -ScriptBlock {
|
|
param($selected, $apps)
|
|
|
|
$sync.ProcessRunning = $true
|
|
Write-WinUtilLog -Component "AppX" -Message "Starting AppX removal for $(@($selected).Count) selected package(s)."
|
|
|
|
foreach ($key in $selected) {
|
|
if ($key -eq "WPFAppxMicrosoft_XboxGamingOverlay") {
|
|
# Making sure Game Bar isn't running
|
|
Write-WinUtilLog -Component "AppX" -Message "Stopping GameBarFTServer before removing Xbox Gaming Overlay."
|
|
Stop-Process -Name GameBarFTServer
|
|
|
|
# This stops annoying ms-gamebar popup when launching games.
|
|
Write-WinUtilLog -Component "AppX" -Message "Disabling Game DVR capture before removing Xbox Gaming Overlay."
|
|
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
|
|
Write-WinUtilLog -Component "AppX" -Message "Stopping dllhost before removing Notepad."
|
|
Stop-Process -Name dllhost
|
|
}
|
|
|
|
Write-Host "Removing $($apps[$key].Content)"
|
|
Write-WinUtilLog -Component "AppX" -Message "Removing $($apps[$key].Content) ($($apps[$key].PackageId))."
|
|
Get-AppxPackage -Name $apps[$key].PackageId -AllUsers | Remove-AppxPackage -AllUsers
|
|
|
|
if ($key -eq "WPFAppxMSTeams") {
|
|
# Uninstalls Microsoft Teams Meeting Add-in for Microsoft Office
|
|
Write-WinUtilLog -Component "AppX" -Message "Uninstalling Microsoft Teams meeting add-in package."
|
|
Get-Package -Name "Microsoft Teams*" -ErrorAction SilentlyContinue | Uninstall-Package -Force
|
|
}
|
|
}
|
|
|
|
Write-Host "================================="
|
|
Write-Host "-- AppX Removal Finished ---"
|
|
Write-Host "================================="
|
|
Write-WinUtilLog -Component "AppX" -Message "AppX removal finished."
|
|
|
|
$sync.ProcessRunning = $false
|
|
}
|
|
}
|