1

I try to remove all windows 10 default apps, except some specific apps(for example windows store and windows dvd player). The only way I found via google to do this, is the following Powershell-Command:

Get-AppxPackage | Remove-AppxPackage | where-object {$_.Name -notlike "Microsoft.WindowsDVDPlayer", "*store*"}

This seems to work for everyone, except me. The command removes all apps for the logged in user and seems to ignore the "where-object" part. Is there any other way to do this(or does someone know why it won't work for me) ?

SaintCore
  • 58
  • 5

1 Answers1

1

The Remove-AppxPackage command must be at the end. You must filter the list before processing it.

Like this:

Get-AppxPackage | Where-Object { $_.Name -notlike "Microsoft.WindowsDVDPlayer", "*store*" } | Remove-AppxPackage
Frederick Marcoux
  • 555
  • 2
  • 6
  • 16
  • 1
    Didn't even noticed that I've posted this as a question here. Found the solution by myself in the meantime but you're solution is right. :) – SaintCore Mar 16 '18 at 16:51
  • DON'T use it. It still has the wrong syntax. Everything will be removed. Here is the correct example of the multiple `-notlike`: https://stackoverflow.com/a/849143/11468937 – KeyKi Apr 28 '22 at 15:31