Files
winutil/functions/private/Remove-WinUtilAPPX.ps1
2026-07-01 19:48:43 -05:00

24 lines
704 B
PowerShell

function Remove-WinUtilAPPX {
<#
.SYNOPSIS
Removes all APPX packages that match the given name
.PARAMETER Name
The name of the APPX package to remove
.EXAMPLE
Remove-WinUtilAPPX -Name "Microsoft.Microsoft3DViewer"
#>
param (
$Name
)
Write-Host "Removing $Name"
Write-WinUtilLog -Component "AppX" -Message "Removing AppX package pattern: $Name"
Get-AppxPackage $Name -AllUsers | Remove-AppxPackage -AllUsers
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $Name | Remove-AppxProvisionedPackage -Online
Write-WinUtilLog -Component "AppX" -Message "AppX removal completed for package pattern: $Name"
}