PowerShell -Command "Get-appxprovisionedpackage –online | where-object {$_.packagename –like "*windowsalarms*"} | remove-appxprovisionedpackage –online" I am trying to get this to work in a .bat file. What am I doing wrong? I am told that it needs to use the Elevated PS? I don't know. I am running it in admin and it's not working. I just get an error. See attached file for the actual .bat file I am running. What's wrong with it?
Did you change the execution policy ? Run ps as administrator. Then input set-executionpolicy remotesigned. Now run the script.
More quotes around the package name will also work. The command I use: Spoiler powershell "Get-appxprovisionedpackage -online | where-object {$_.packagename -like """*windowsalarms*"""} | remove-appxprovisionedpackage -online"
Code: This app is part of Windows and cannot be uninstalled [...] To resume and from my point of view, it's might be better (and easier to learn) to replace powershell by dism. Because in the past I had try several times and it has never work fine. That's just one advice because it will avoid this kind of errors.
Hey thanks for the quick response, here is the error which shows for all commands. packagename : The term '.packagename' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:52 + ... t-appxprovisionedpackage –online | where-object {.packagename –like ... + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (.packagename:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Easy way to remove the windows apps is using Ccleaner. anyone know how to remove or block ads from windows apps?
You should run that as a batch script (.bat file). You don't even need to run it as admin, just double click the bat file. I used similar code to install some app without using the store. Forget what I wrote, it does not work now when I tested in a VM. It works for installing appx by using "Add-AppxPackage -Path" but it does not work for removing. Sorry, should have tested before posting.