From eec16bdce5e29fd965e457f378967a693d72dc93 Mon Sep 17 00:00:00 2001 From: Gabi <182965942+GabiNun@users.noreply.github.com> Date: Thu, 8 Jan 2026 20:29:55 +0200 Subject: [PATCH] Update-Remove-WinUtilAPPX.ps1 (#3822) * Update Remove-WinUtilAPPX.ps1 * Modify Remove-WinUtilAPPX.ps1 to adjust package removal Removed '-AllUsers' parameter from Remove-AppxProvisionedPackage call. * Update Remove-WinUtilAPPX.ps1 * Fix formatting in Remove-WinUtilAPPX.ps1 * Update Remove-WinUtilAPPX.ps1 --- functions/private/Remove-WinUtilAPPX.ps1 | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/functions/private/Remove-WinUtilAPPX.ps1 b/functions/private/Remove-WinUtilAPPX.ps1 index e90a101b..12c0ed42 100644 --- a/functions/private/Remove-WinUtilAPPX.ps1 +++ b/functions/private/Remove-WinUtilAPPX.ps1 @@ -15,19 +15,7 @@ function Remove-WinUtilAPPX { $Name ) - try { - Write-Host "Removing $Name" - Get-AppxPackage "*$Name*" | Remove-AppxPackage -ErrorAction SilentlyContinue - Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like "*$Name*" | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue - } catch [System.Exception] { - if ($psitem.Exception.Message -like "*The requested operation requires elevation*") { - Write-Warning "Unable to uninstall $name due to a Security Exception" - } else { - Write-Warning "Unable to uninstall $name due to unhandled exception" - Write-Warning $psitem.Exception.StackTrace - } - } catch { - Write-Warning "Unable to uninstall $name due to unhandled exception" - Write-Warning $psitem.Exception.StackTrace - } + Write-Host "Removing $Name" + Get-AppxPackage $Name -AllUsers | Remove-AppxPackage -AllUsers + Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Name | Remove-AppxProvisionedPackage -Online }