mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-07-16 00:40:39 +00:00
24 lines
704 B
PowerShell
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"
|
|
}
|