Help with remove Appxpackage for all users

I am looking for a way to delete a Windows store app for all user profiles.

I tried this script but it is not really deleting the Appx app for all the profiles.

get-appxpackage Microsoft.VP9VideoExtensions* | remove-appxpackage -ErrorAction SilentlyContinue
# or
get-appxpackage -allusers Microsoft.HEVCVideoExtension* | remove-appxpackage -ErrorAction SilentlyContinue
# or
get-appxpackage -allusers Microsoft.HEVCVideoExtension* | remove-appxpackage -allusers -ErrorAction SilentlyContinue

How is that question different to the one you asked yesterday?

Sorry. I was thinking that I did not post it. Sorry again.

We use something similar to this:

Get-AppxProvisionedPackage -Online | 
    Remove-AppxProvisionedPackage -AllUsers 

Thank you Olaf, but that is not a specific Appx.

I tried this but getting an error:

Get-AppxProvisionedPackage -Online | 
select-object displayname, displayversion |
Select-Object -match Microsoft.WebpImageExtension |
    Remove-AppxProvisionedPackage -AllUsers 

I think this may work. I will try and see.

Get-AppxProvisionedPackage -Online | 
select-object displayname, PackageName |
Where-Object {$_.PackageName -match 'Microsoft.HEVCVideoExtension'} |
    Remove-AppxProvisionedPackage -AllUsers 

My final script and it works. :smile:


$appname = @(
"Microsoft.WebMediaExtensions"
"Microsoft.MSPaint"
"Microsoft.VP9VideoExtensions"
"Microsoft.Microsoft3DViewer"
"Microsoft.HEIFImageExtension"
)
ForEach($app in $appname){
Get-AppxProvisionedPackage -Online | where {$_.PackageName -match $app} | 
Remove-AppxProvisionedPackage -AllUsers -ErrorAction SilentlyContinue
}

Thank you Olaf!